diff options
| author | Martin Hořeňovský | 2026-07-26 10:51:31 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-07-26 15:50:33 +0200 |
| commit | 60c8b878292ec4afc625a807cdc3902397a408a3 (patch) | |
| tree | 91543a1fdd5dc6c0bca89f10d851d9300c917f7f /src/Progmasoft/Catch3/Message.cpp | |
| parent | 64a551e2e7edb85e4f2cd99e5737a587eb06c35b (diff) | |
| download | catch3-60c8b878292ec4afc625a807cdc3902397a408a3.tar.gz | |
Avoid n^2 behaviour when appending script commands in catch_discover_tests
Repeatedly calling `string(APPEND` on the same destination string
leads to quadratic running time. We avoid this by flushing the CTest
script into a file periodically, currently every 50kB of text.
This can cause _slight_ slowdown just around the flush boundary (each
file write is quite expensive, so if we flush just before the last test
is written, it hurts), but it avoids terrible performance for large
test suites.
The performance is roughly equal at 500 tests to discover, and clearly
wins at more; for 1/2/4/8 k tests, the improvements are 0.3/1.6/6.4/27 s.
Diffstat (limited to 'src/Progmasoft/Catch3/Message.cpp')
0 files changed, 0 insertions, 0 deletions