Repository navigation
Conversation
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Audited and verified. Removing the user-declared destructor allows the compiler to generate implicit move constructors and move assignment operators for Json, enabling std::vector reallocations and parser insertions to move subtrees instead of deep-copying. Clean-room compliant. Approved.
|
Recommendation: [MERGE] Reasoning: Removes Impact level: 2/10 |
605c890 to
f6ea7b6
Compare
f6ea7b6 to
269971a
Compare
Claimed in the coordination issue as: RT-JSON-SUBTREE-MOVES (claim)
What and why
The explicitly defaulted destructor suppresses the implicit move constructor of
Json. Passing a parsed child to a vector withstd::movetherefore copies its strings and nested vectors. Growing an object or array can copy those subtrees again. Letting the compiler generate the destructor restores nonthrowing moves for bothJsonandJsonObjectEntry. The forward declaration still supports recursive object values.Tested
shader_library_testandmods_testpassed under MSVC x64, GCC 11.4 and Clang 18.1.8 with libstdc++. Clang 15 with libstdc++ 11 rejects the existing C++20 aggregate construction inemplace_backon both revisions.A synthetic input had 1,200 named entries, each with a label and four arrays of six small objects. Both builds produced 181,201 nodes and the same tree digest from the 1,141,381-byte document. Five interleaved release runs per revision under MSVC gave median parse times of 71.14 ms before and 17.46 ms after. Allocation counts fell from 822,984 to 176,419. File reads and digest calculation were outside the timed region.
git diff --checkandscripts/check_no_game_data.py runtime/src/shader_library.hpassed.The general translator suite ran 6,168 tests across 470 files with zero failing files.
GPUs tested: n/a, CPU-only JSON parsing.
AI-assisted: yes, Codex.
Checklist
mainand merges cleanly.