Jump to content

Thijs van Dien

  • Content Count

  • Joined

  • Last visited

Community Reputation

4 Neutral

Technical Information

  • Delphi-Version
    Delphi 2010

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thijs van Dien

    InterBase or Firebird?

    Proprietary databases are a no go IMHO, when there are plenty of excellent alternatives.
  2. Thijs van Dien

    pre-generic dictionary class

    I was surprised by @dummzeuch's benchmark results, so ran my own. In short, I created 44350 strings by taking 8870 English words and appending 1 to 5 to them, added half of them (index odd) to the data structure, to finally check for all of them if they were present. The experiment was repeated 100 times, and the listed results are the average total time for each action: TStringList - Add: 143.44 ms - TryGet: 123.09 ms TStringHash (Size = 256) - Add: 23.58 ms - TryGet: 62.56 ms TStringHash (Size = 512) - Add: 17.09 ms - TryGet: 40.54 ms TStringHash (Size = 1024) - Add: 13.47 ms - TryGet: 29.3 ms TStringHash (Size = 2048) - Add: 11.45 ms - TryGet: 21.68 ms TStringHash (Size = 4096) - Add: 10.2 ms - TryGet: 18.41 ms TStringHash (Size = 8192) - Add: 9.49 ms - TryGet: 16.28 ms TStringHash (Size = 16384) - Add: 9.17 ms - TryGet: 15.21 ms TStringHash (Size = 32768) - Add: 8.73 ms - TryGet: 14.24 ms TStringHash (Size = 65536) - Add: 8.68 ms - TryGet: 14.03 ms TDictionary - Add: 10.2 ms - TryGet: 16.09 ms TSynDictionary - Add: 9.02 ms - TryGet: 14.99 ms If you're really interested, I can send you the code, but I think these results make sense. As long as the number of buckets is somewhat appropriate, a TStringHash outperforms TDictionary even. Possibly the former has a more specialized hash function, or simply does less other work (e.g. no accounting for reallocation). Note that I did make it fair by checking for duplicates in TStringHash too. If you don't need that, it becomes even faster.
  3. Thijs van Dien

    pre-generic dictionary class

    TStringHash is a completely different class than THashedStringList and gives you exactly what you asked for: string to Integer (Pointer). I've been happily using it in D6 and it's still publicly available in D2010 (the latest version I have at hand). Sure it might not be the absolute optimal solution, but it will be a noticeable improvement over the status quo, is very understandable, and doesn't need any third party code.
  4. Thijs van Dien

    pre-generic dictionary class

    Did you consider IniFiles.TStringHash? It has a fixed number of buckets, but you could compose it and implement your own reallocation logic if desired. Also, you could inherit from it to use a better hash should the default not be good enough.
  5. Thijs van Dien

    JSON as a way to save information in Firebird

    I would suggest to at least not go the JSON route. If you don't want to go fully relational, and don't have too much nesting, you could use something like the Entity-Attribute-Value (EAV) pattern. When done correctly, that's still quite workable with a RDBMS like Firebird while already offering greater flexibility (with which also comes greater responsibility). It could strike a nice balance.
  6. Thijs van Dien

    Recommended Cryptographic Library

    If you can get away with its limited functionality (which is sort of the point), just use libsodium.
  7. Thijs van Dien

    Signing executables

    @Vincent Parrett Later versions of Inno Setup have several options for retrying, so it's not a problem for me. The only thing that still doesn't work to well is aborting the compilation when it's signing.
  8. Thijs van Dien

    Signing executables

    I have a certificate issued by Comodo and let Inno Setup take care of it. As also covered in the blog post linked above, if you obtain a timestamp from a trusted party (special server) when signing, the signature will remain valid. For me the most useful resource was this: https://www.zabkat.com/blog/code-signing-sha1-armageddon.htm.
  9. Thijs van Dien

    Blogged : Delphi Package Manager RFC

    A proper way to make design-time packages part of my project rather than of my IDE is just about the only thing that could get me to upgrade Delphi ever again. I'm sure it will be technically challenging, and that any implementation would be buggy for a long time (as with most even mildly complicated new features), but done well it would be a big step forward. Yes, packages would have to be made compatible with it, but the same was true for GetIt. As long as the old style "IDE packages" keep working too, I don't see the problem. It could be a chance to streamline how packages must be written and hopefully adding any paths would no longer be necessary for such "project packages". If it will still be possible for such packages to make hard to reverse changes to the IDE at runtime, some kind of sandboxing would be needed.
  10. Thijs van Dien

    Welcome to the English speaking Delphi-PRAXiS

    Hi everyone! I'm happy to join this site. I've been an observer of the Google+ community, but never created an account there because of my dislike for Google+.