Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Catch3/Internal/RandomNumberGenerator.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-07-24 12:22:49 +0200
committerMartin Hořeňovský2026-07-26 15:50:31 +0200
commit64a551e2e7edb85e4f2cd99e5737a587eb06c35b (patch)
treea68098c7b8808b76d5df0edb8dfb16fc98f469c1 /src/Progmasoft/Catch3/Internal/RandomNumberGenerator.cpp
parent2b971368dd9ba954604f45e748fb2d46493bb7d7 (diff)
downloadcatch3-64a551e2e7edb85e4f2cd99e5737a587eb06c35b.tar.gz
Optimize adding test commands in catch_discover_tests
The previous approach was for `add_command` to behave as append function via concatenating the command string internally and then saving it into `PARENT_SCOPE`. Because this in practice ended up meaning concatenating a copy of the string inside the function and then overwriting the string outside the function, the performance was lacking. The new approach is for `prepare_command` to only escape & return the command from single call, and the caller is responsible for concatenating the result. Since the actual concatenation no longer crosses function scope boundaries, the performance is much better, even though the scaling is still quadratic. The new approach only takes 1/4-1/5 of the time, saving ~1s at 1k tests, 4.5s at 2k tests and 19s at 4k tests.
Diffstat (limited to 'src/Progmasoft/Catch3/Internal/RandomNumberGenerator.cpp')
0 files changed, 0 insertions, 0 deletions