This project has 104 classes.
ECF: benchmark.ecf
Source code: directory list
SUB-APPLICATIONS
The benchmark application has a total of 4 sub-applications that each serve a different purpose and can be reached with a command option obtained by lower-casing the class name and removing the "_app" suffix.
EL_APPLICATION* PRIMES_BENCHMARK_APP EL_COMMAND_LINE_APPLICATION* [${C -> EL_APPLICATION_COMMAND}] EL_COMMAND_SHELL_APPLICATION* [${C -> EL_APPLICATION_COMMAND_SHELL}] BENCHMARK_APP STRING_BENCHMARK_APP ZSTRING_BENCHMARK_APP
HEIRARCHY
The descendants of EL_BENCHMARK_COMPARISON below were created to benchmark particular code characteristics. Any of the benchmarks can be run from a menu shell.
The class DEVELOPER_COMPARISON is used to create throw-away benchmarks that answer particular questions. After benchmarking new code, it is discarded but the results are documented in the section "Benchmark Journal" below.
EL_BENCHMARK_COMPARISON* STRING_BENCHMARK_COMPARISON* SUBSTRING_INDEX_COMPARISON ZSTRING_DEVELOPER_COMPARISON ARRAYED_INTERVAL_LIST_COMPARISON IMMUTABLE_STRING_SPLIT_COMPARISON LINE_STATE_MACHINE_COMPARISON MAKE_GENERAL_COMPARISON STRING_ITEM_8_VS_ITEM REPLACE_SUBSTRING_ALL_VS_GENERAL COMPACT_SUBSTRINGS_32_ITERATION_COMPARISON COMPACT_SUBSTRINGS_32_BUFFERING_COMPARISON UNICODE_ITEM_COMPARISON ZCODEC_AS_Z_CODE ZSTRING_APPEND_GENERAL_VS_APPEND ZSTRING_APPEND_Z_CODE_VS_APPEND_CHARACTER ZSTRING_AREA_ITERATION_COMPARISON ZSTRING_INTERVAL_SEARCH_COMPARISON ZSTRING_SAME_CHARACTERS_COMPARISON ZSTRING_SPLIT_COMPARISON ZSTRING_TOKENIZATION_COMPARISON ZSTRING_UNICODE_TO_Z_CODE STRING_SPLIT_ITERATION_COMPARISON IF_ATTACHED_ITEM_VS_CONFORMING_INSTANCE_TABLE ZSTRING_SPLIT_LIST_COMPARISON STRING_CONCATENATION_COMPARISON STRING_8_TWIN_VS_SCOPE_COPIED_ITEM ARRAYED_VS_HASH_SET_SEARCH ATTACH_TEST_VS_BOOLEAN_COMPARISON BIT_POP_COUNT_COMPARISON BIT_SHIFT_COUNT_COMPARISON CLASS_ID_ENUM_VS_TYPE_OBJECT DIRECTORY_WALK_VS_FIND_COMMAND HASH_TABLE_VS_NAMEABLES_LIST_SEARCH LIST_ITERATION_COMPARISON P_I_TH_LOWER_UPPER_VS_INLINE_CODE REFLECTED_REFERENCE_VS_OPTIMIZED_FIELD_RW ROUTINE_CALL_ON_ONCE_VS_EXPANDED SYSTEM_TIME_COMPARISON TOKENIZED_STEPS_VS_XPATH_STRING ARRAYED_VS_LINKED_LIST STRING_8_SPLIT_VS_SPLIT_ON_CHARACTER_8 COMPACTABLE_REFLECTIVE_VS_MANUAL_BIT_MASK DEVELOPER_COMPARISON
BENCHMARK JOURNAL
23 March 2025
Find fastest way to test detachable representation to increment the counter. The fastest method is to test if representation = Void. Other methods are 1/3 slower.
when 1 then if attached {EL_STRING_FIELD_REPRESENTATION [INTEGER, ANY]} representation as l_rep then do_nothing else counter := counter + 1 end when 2 then if representation = Void then counter := counter + 1 elseif attached {EL_STRING_FIELD_REPRESENTATION [INTEGER, ANY]} representation as l_rep then do_nothing end when 3 then if has_representation and then attached {EL_STRING_FIELD_REPRESENTATION [INTEGER, ANY]} representation as l_rep then do_nothing else counter := counter + 1 end
Passes over 500 millisecs (in descending order)
method 2 : 47911.0 times (100%) method 3 : 32334.0 times (-32.5%) method 1 : 31783.0 times (-33.7%)
6 October 2024
Finding a ZSTRING type at the end of list of 500 STRING_8 objects.
Result := across string_general_list as list 1. some list.item.generating_type = {ZSTRING} 2. some {ISE_RUNTIME}.dynamic_type (list.item) = ZSTRING -- THE WINNER 3. some {ISE_RUNTIME}.dynamic_type (list.item) = ({ZSTRING}).type_id 4. some list.item.same_type (Zstring_object) end
Passes over 2000 millisecs (in descending order)
method 2 : 65.0 times (100%) method 4 : 63.0 times (-3.1%) method 3 : 18.0 times (-72.3%) method 1 : 15.0 times (-76.9%)
26 August 2024
Testing if ZSTRING conforms to READABLE_STRING_32 using class EL_INTERNAL and EL_CLASS_TYPE_ID_ENUM
when 1 then Result := attached {READABLE_STRING_32} str when 2 then Result := field_conforms_to (dynamic_type (str), class_id.READABLE_STRING_32) when 3 then Result := class_id.readable_string_32_types.has (dynamic_type (str)) -- ARRAY [INTEGER] when 4 then Result := is_type_in_set (dynamic_type (str), class_id.readable_string_32_types) -- THE WINNER
Passes over 500 millisecs (in descending order)
method 4 : 7399.0 times (100%) method 3 : 4725.0 times (-36.1%) method 1 : 4272.0 times (-42.3%) method 2 : 3300.0 times (-55.4%)
5 June 2024
Loop to remove steps until path does not have a parent
path.parent: 43.0 times (100%) steps.remove_tail: 25.0 times (-41.9%)
13 April 2024
Method for {EL_INTEGER_MATH}.natural_digit_count
Passes over 500 millisecs (in descending order)
quotient := quotient // 10 : 422.0 times (100%) {DOUBLE_MATH}.log10 : 196.0 times (-53.6%)
13 Dec 2023
Passes over 500 millisecs (in descending order)
C_date: C_DATE; System_time: EL_SYSTEM_TIME System_time.update: 231.0 times (100%) C_date.update: 105.0 times (-54.5%)
. /source/comparison/special-string
. /source/comparison/structures
. /source/obsolete/string-buffer
Application root
Build specification
Further Information
Click on class link to see notes.
Benchmark shell menu STRING_BENCHMARK_SHELL for string related performance tests
Further Information
Click on class link to see notes.
Command line interface to create and execute ZSTRING_BENCHMARK_COMMAND
Compare checking if identifier is attached vs checking if boolean is true
Compare methods to caculate population of 1's in NATURAL_64
Once off comparisons for developer testing
Further Information
Click on class link to see notes.
Finding files with extension comparison
Compare call on expanded vs once ref object
Click on class link to see notes.
Compare {L1_UC_STRING}.make_general and {ZSTRING}.make_general
Compare {L1_UC_STRING}.unicode and {ZSTRING}.unicode
Compact substrings buffering comparison
Compare EL_COMPACT_SUBSTRINGS_32 iteration methods
Compare conditional assignment depending on consecutive elseif attachment attempts to two experimental techniques:
Further Information
Click on class link to see notes.
Compare iterating immutable VS changeable string list
Further Information
Click on class link to see notes.
Test variations of class CSV_LINE_PARSER
Replace substring comparison
Compare parsing comma separated list of reals using across iteration over:
Further Information
Click on class link to see notes.
Compare 3 ways to make a temporary copy of STRING_8
Further Information
Click on class link to see notes.
String benchmark comparison
Compare various ways of concatenating strings
Compare {READABLE_STRING_GENERAL}.to_integer with {EL_STRING_TO_INTEGER_32}.as_type
Further Information
Click on class link to see notes.
Compare {STRING_8}.item VS character_32_item
String split iteration comparison
Further Information
Click on class link to see notes.
Substring index comparison
Compare filling LINKED_LIST with filling ARRAYED_LIST
Compare 7 ways to iterate over a list
Ways to implement {EL_ZCODEC}.as_zcode
{ZSTRING}.append_z_code VS {ZSTRING}.append_character
Once off comparisons for developer testing
Further Information
Click on class link to see notes.
ZSTRING split comparison
Further Information
Click on class link to see notes.
Compare {EL_ZSTRING}.split_list with {EL_ZSTRING_LIST}.make_split
Further Information
Click on class link to see notes.
Methods to obtain z_code from unicode character
Further Information
Click on class link to see notes.
Benchmark html
Benchmark table
Memory benchmark table
Performance benchmark table
Zstring benchmark command
Cursor to use an across loop as an artificial scope in which a temporary STRING_32 buffer can be borrowed from a shared pool. After iterating just once the scope finishes and the buffer item is automatically returned to the shared pool stack.
Further Information
Click on class link to see tests.
Cursor to use an across loop as an artificial scope in which a temporary STRING_8 buffer can be borrowed from a shared pool. After iterating just once the scope finishes and the buffer item is automatically returned to the shared pool stack.
Further Information
Click on class link to see tests.
Cursor to use an across loop as an artificial scope in which a temporary string buffer conforming to STRING_GENERAL can be borrowed from a shared pool. After iterating just once the scope finishes and the buffer item is automatically returned to the shared pool stack.
Further Information
Click on class link to see notes.
Defines an across loop scope in which a string conforming to STRING_GENERAL can be borrowed from a factory pool and then automatically returned after the first and only iteration of the cursor.
Cursor to use an across loop as an artificial scope in which a temporary ZSTRING buffer can be borrowed from a shared pool. After iterating just once the scope finishes and the buffer item is automatically returned to the shared pool stack.
Further Information
Click on class link to see tests.
Shared instances of reusable string buffers for type STRING_32 accessible via across loop scope.
Further Information
Click on class link to see notes.
Shared instances of reusable string buffers for type STRING_8 accessible via across loop scope.
Further Information
Click on class link to see notes.
Shared instances of reusable string buffers for type ZSTRING accessible via across loop scope.
Further Information
Click on class link to see notes.
Map character capacities to reuseable buffer strings. A negative count indicates that the string item is "on loan" as a buffer. A positive count indicates the string is available to borrow.
The borrowed_item routine returns the best match for a preferred capacity.
Defines an across loop scope in which multiple strings can be borrowed from a shared pool and automatically returned when the loop exits after first and only iteration
Artificial scope defined by an across loop in which strings can be borrowed from a pool See class EL_STRING_POOL_SCOPE
CSV parser for lines encoded as Latin-1
CSV parser for lines encoded as Latin-1
CSV parser using agent states
CSV parser for lines encoded as Latin-1
Scan Rhythmbox database for total file size
Command to calculate primes using the the sieve of Eratosthenes method
TO_SPECIAL [BOOLEAN] implementation of PRIME_NUMBER_COMMAND
MANAGED_POINTER implementation of PRIME_NUMBER_COMMAND
EL_CPP_BOOLEAN_VECTOR implementation of PRIME_NUMBER_COMMAND
Implementation using bits compacted into an array of type SPECIAL [NATURAL_32]
Benchmark constants
Benchmark using a mix of Latin and Unicode encoded data
STRING_32 routines for benchmarking
Benchmark using pure Latin encodable string data
String routines for benchmarking
Test strings
ZSTRING routines for benchmarking
Benchmark using a mix of Latin and Unicode encoded data
Benchmark using pure Latin encodable string data
Test string 32
Benchmark using a mix of Latin and Unicode encoded data
Test zstring
Benchmark using pure Latin encodable string data
Command shell for various kinds of performance comparison benchmarks
EL_COMPACT_SUBSTRINGS_32_ITERATION that uses inline C for pointer get/set
Fast lookup of item in unencoded intervals array by caching area_index
Further Information
Click on class link to see notes.
Expanded ANY
String related benchmark comparisons