Improve speed of non visual string storage component
Budget: $30 – $250 USD
Attached is sample project with a reference implementation of TFixedStringStorageRef. It is a non visual component used to store a rather large set of strings (about 150 KB of data), optimized for searching. The searching is case insensitive, full match (i.e. no partial matching) search. The data set is fixed, that is, the component does not need to support removing data from the structure.
Basically, it implements a faster version of:
Data := TStringList.Create;
Data.AddStrings(some_data);
Data.Sort();
If Data.IndexOf('something') > -1 then ...
Your job is to implement with Delphi 11 or compatible, TFixedStringStorage as a faster implementation of TFixedStringStorageRef in a way it does not use more than 50% more RAM than the current implementation. The current implementation is done using TDictionary<String,Boolean> where the Boolean data is not even used.
The faster implementation should either be a binary search tree of some kind, or some kind of hashed list where you can take advantage of serializing the data from disk (i.e. save the hash values to disk during serialization instead of calculating them all each time).
The code must not rely on any third party code and must be 100% pure Delphi/Pascal code.
Basically, it implements a faster version of:
Data := TStringList.Create;
Data.AddStrings(some_data);
Data.Sort();
If Data.IndexOf('something') > -1 then ...
Your job is to implement with Delphi 11 or compatible, TFixedStringStorage as a faster implementation of TFixedStringStorageRef in a way it does not use more than 50% more RAM than the current implementation. The current implementation is done using TDictionary<String,Boolean> where the Boolean data is not even used.
The faster implementation should either be a binary search tree of some kind, or some kind of hashed list where you can take advantage of serializing the data from disk (i.e. save the hash values to disk during serialization instead of calculating them all each time).
The code must not rely on any third party code and must be 100% pure Delphi/Pascal code.
Related categories:
Delphi