A manifest table of key/items of type IMMUTABLE_STRING_8

14 views
Skip to first unread message

Finnian Reilly

unread,
Jul 15, 2023, 7:01:44 AM7/15/23
to Eiffel Users
A manifest table of key/items of type IMMUTABLE_STRING_8
(Finnian Reilly 15 July 2023)

The class EL_IMMUTABLE_STRING_8_TABLE (inheriting EL_IMMUTABLE_STRING_TABLE) has some interesting properties for the Feature_expansion_table  example shown below.
  1. It uses precisely one shared SPECIAL character array, and that is the actual one supplied with the manifest string argument. Not a copy.
  2. It uses 53 % less memory then if you were to represent the same data using a table of type HASH_TABLE [STRING, STRING]
  3. It uses 71 % fewer objects in memory than a standard table
It achieves this partly by using shared substrings and partly by making table items virtual, meaning they are recreated on each lookup from interval information represented as a bit-combined-shifted INTEGER_64.

Feature_expansion_table.pngtest_immutable_string_table.pngtest_immutable_string_table-output.png
Reply all
Reply to author
Forward
0 new messages