THURSDAY, SEPTEMBER 24, 2026
cobol Performance Win
cobol: Cache COBPATH directories for shared object searches
GCC's COBOL runtime now caches COBPATH directories to speed up shared object searches.
The COBOL runtime library has been updated to cache directories specified in the COBPATH environment variable. This optimization speeds up the process of locating dynamically linked shared objects (.so files) used by COBOL programs. New test cases are included to verify functionality.
In Details
libgcobol's function_handle_from_cobpath now uses a cached array of directories derived from the COBPATH environment variable. This avoids repeatedly parsing COBPATH during calls to find_in_dirs, improving the performance of dynamic linking for COBOL programs. The change impacts how shared libraries are located at runtime.
For Context
- COBPATH
- An environment variable used by the GNU Cobol compiler to specify directories where shared libraries (.so files) should be searched for when dynamically linking.
- shared object
- A file containing compiled code and data that can be loaded and linked by programs at runtime. Equivalent to DLLs on Windows or .dylib on macOS. In Linux, these typically have a .so extension.
- dynamic linking
- A process in which executable code is linked with libraries at run time, rather than during the compilation or build process. This allows code to be shared among multiple programs and updated independently.