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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/UsageTests/ToStringVector.tests.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-08-21 23:36:22 +0200
committerMartin Hořeňovský2025-08-22 17:00:40 +0200
commitfb2e4fbe413824a5cad4101c0e94cb10b7828f0d (patch)
tree8da4e08aeeea0d85f71f5db767a832085a9f8666 /tests/SelfTest/UsageTests/ToStringVector.tests.cpp
parent78a9518a2847f82cb65124d65eaf0b0be8d90cdc (diff)
downloadcatch3-fb2e4fbe413824a5cad4101c0e94cb10b7828f0d.tar.gz
Improve performance of writing JSON values
The old code was exceedingly simple, as it went char-by-char and decided whether to write it to the output stream as-is, or escaped. This caused a _lot_ of stream writes of individual characters. The new code instead looks for characters that need escaping, and bulk-writes the non-escaped characters in between them. This leads to about the same performance for strings that comprise of only escaped characters, and 3-10x improvement for strings without any escaping needed. In practice, we should expect the former rather than the latter, but this is still nice improvement.
Diffstat (limited to 'tests/SelfTest/UsageTests/ToStringVector.tests.cpp')
0 files changed, 0 insertions, 0 deletions