Repository navigation
docs: update the objectMechanism section - #939
Merged
Merged
Conversation
Tony133
marked this pull request as ready for review
November 22, 2026 15:24
gurgunday
approved these changes
Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal:
Datevalues in theobjectMechanismsection, which is wrong since v7.3.9.Problem:
The README still says to keep the default mechanism when the objects have
Datevalues informat: date-timeproperties, because there the default mechanism is 1.2-1.7x faster. That was true until v7.3.8. Since #935 it is the opposite, so today the README advises against the option exactly where it gains the most.The other numbers of the section were measured on v7.3.5 and do not cover
$ref.Change:
Datevalues are now a reason to enable the option. The projection writes them 1.8-2.1x faster than the default mechanism and 4-5x faster thanJSON.stringify.$ref; about 4x faster thanJSON.stringifywhen each object has three undeclared properties.JSON.stringifyon plain data: 5-16% in the section, 2-16% in the introduction. The 2-6% of the fixtures inbenchmark/is unchanged.Benchmark:
Node v26.13.0, Apple Silicon, fast-json-stringify v7.3.10, ops/sec.
The 2.1x on
Datevalues comes from the table in #935 (list of 50 rows with onedate-time: 111.8k against 52.1k, and 26.6k forJSON.stringify).Note: