COBOL STRING and UNSTRING routines refactored for speed.
COBOL STRING/UNSTRING routines are now specialized for single-byte and multi-byte character sets, significantly speeding up single-byte operations.
The COBOL STRING and UNSTRING statement implementations have been refactored into separate routines optimized for single-byte character sets and multi-byte character sets. This specialization leads to substantial performance improvements when processing single-byte encoded strings, which is a common use case.
In Details
The libgcobol implementation of COBOL's STRING and UNSTRING statements has been bifurcated. Optimized paths for single-byte character sets (__gg__string_1, __gg__unstring_1) and multi-byte character sets (__gg__string_24, __gg__unstring_24) are now selected at runtime, improving performance for the common single-byte case.
- STRING statement
- A COBOL statement used to concatenate data items into a single string.
- UNSTRING statement
- A COBOL statement used to parse a string and move parts of it into different data items.
- single-byte character set
- A character encoding where each character is represented by a single byte.
- multi-byte character set
- A character encoding where characters can be represented by one or more bytes.