Commit Graph

5 Commits

Author SHA1 Message Date
Francisco Geiman Thiesen cd4a074653 WIP: bump DEFAULT_INITIAL_CAPACITY to 256KB
Most CITM/Twitter realloc cost was due to growing from 1024 in 7-9 doublings
to reach the actual output size. Bumping the initial capacity to 256KB means
Twitter (82KB) fits in one allocation and CITM (496KB) only needs 1 growth.

Measured (TRUE A/B, 7 alternating rounds in single docker, with all prior
follow-ups in this branch + this cap bump):
  CITM:    4358 -> 4924 MB/s  (+13.0%)  - now ~2.3% AHEAD of Glaze
  Twitter: 6338 -> 8034 MB/s  (+26.8%)  - ~50% AHEAD of Glaze

Trade-off: 256KB upfront per string_builder instance. Reasonable for
high-perf JSON serialization but wasteful for tiny one-off messages.
Users serializing small payloads should pass a smaller initial_capacity
to the constructor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 16:13:26 -07:00
Francisco Geiman Thiesen 0ab7e2d701 WIP: template append_raw on size for compile-time-inlined memcpy
Add append_raw_n<N>(const char*) which propagates the key length as a
template parameter, letting the compiler emit a fully inlined memcpy
with a constant size (direct loads/stores) instead of the size-passed-
as-runtime-arg variant which sometimes fell back to a libc memcpy
dispatch.

Use it in the reflection struct atom for both first_key and rest_key
(both are compile-time constants from define_static_string).

Measured (TRUE A/B, 7 alternating rounds in single docker invocation,
two independent runs combined):
  CITM:    baseline ~4395 -> patched ~4791 MB/s  (+9%)
           Glaze    ~4810 MB/s -> simdjson now at PARITY with Glaze
                                  (within +/- 3% noise across runs)
  Twitter: still well ahead of Glaze, no change from baseline

Output is byte-identical, all reflection comprehensive tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 15:45:08 -07:00
Daniel Lemire 73e69a5e84 Get reflection working without warnings under GCC 16 (#2658)
* wip gcc16

* progress

* minor gcc16 fixes

* final step

* Update include/simdjson/padded_string-inl.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update include/simdjson/padded_string.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* renaming test function

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-03 15:32:42 -04:00
Daniel Lemire 8c5cc8c443 updating the reflection benchmarks (#2598)
* updating the reflection benchmarks

* removing exception during parsing.

* saving.
2026-02-02 11:28:08 -05:00
Daniel Lemire 8b69401d8a moving the builder files in their own directory (#2578) 2026-01-07 18:08:11 -05:00