Describe the bug
The amalgamation script is very slow, running it through Bash takes around 3 minutes for zstd-in.c.
To Reproduce
Steps to reproduce the behavior:
cd build/single_file_libs && time create_single_file_library.sh
Expected behavior
Faster amalgamation.
Solution
I wrote an alternative in Python. It is 135x faster so it takes around 1 second. If you don't want to take an (optional) build dependency on Python, perhaps the shell script could be refactored somehow. There is a comment in the source suggesting that speed was sacrificed for POSIX compliance but the script isn't compliant with POSIX because it uses local.
Describe the bug
The amalgamation script is very slow, running it through Bash takes around 3 minutes for
zstd-in.c.To Reproduce
Steps to reproduce the behavior:
cd build/single_file_libs && time create_single_file_library.shExpected behavior
Faster amalgamation.
Solution
I wrote an alternative in Python. It is 135x faster so it takes around 1 second. If you don't want to take an (optional) build dependency on Python, perhaps the shell script could be refactored somehow. There is a comment in the source suggesting that speed was sacrificed for POSIX compliance but the script isn't compliant with POSIX because it uses
local.