Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: benchmark fast-json-stringify vs JSON.stringify #692

Closed
wants to merge 1 commit into from

Conversation

nigrosimone
Copy link
Contributor

With this PR each benchmark is executed both with fast-json-stringify and JSON.stringify for help developer to compare the result

short string............................................. x 17,031,936 ops/sec ±1.16% (186 runs sampled) (fast-json-stringify)
short string............................................. x 9,878,418 ops/sec ±0.92% (189 runs sampled) (JSON.stringify)

unsafe short string...................................... x 754,072,385 ops/sec ±0.69% (188 runs sampled) (fast-json-stringify)
unsafe short string...................................... x 9,676,614 ops/sec ±1.53% (188 runs sampled) (JSON.stringify)

short string with double quote........................... x 9,396,306 ops/sec ±0.93% (187 runs sampled) (fast-json-stringify)
short string with double quote........................... x 9,309,407 ops/sec ±1.19% (187 runs sampled) (JSON.stringify)

long string without double quotes........................ x 28,134 ops/sec ±1.44% (184 runs sampled) (fast-json-stringify)
long string without double quotes........................ x 13,123 ops/sec ±1.27% (183 runs sampled) (JSON.stringify)

unsafe long string without double quotes................. x 707,753,414 ops/sec ±2.58% (186 runs sampled) (fast-json-stringify)
unsafe long string without double quotes................. x 11,775 ops/sec ±0.54% (186 runs sampled) (JSON.stringify)

long string.............................................. x 12,037 ops/sec ±0.48% (190 runs sampled) (fast-json-stringify)
long string.............................................. x 11,718 ops/sec ±0.98% (186 runs sampled) (JSON.stringify)

unsafe long string....................................... x 727,363,512 ops/sec ±0.84% (189 runs sampled) (fast-json-stringify)
unsafe long string....................................... x 12,137 ops/sec ±0.44% (190 runs sampled) (JSON.stringify)

number................................................... x 761,039,377 ops/sec ±0.32% (192 runs sampled) (fast-json-stringify)
number................................................... x 16,054,549 ops/sec ±1.14% (183 runs sampled) (JSON.stringify)

integer.................................................. x 186,907,293 ops/sec ±0.74% (191 runs sampled) (fast-json-stringify)
integer.................................................. x 16,886,344 ops/sec ±1.86% (182 runs sampled) (JSON.stringify)

formatted date-time...................................... x 1,167,297 ops/sec ±1.03% (187 runs sampled) (fast-json-stringify)
formatted date-time...................................... x 550,689 ops/sec ±1.16% (185 runs sampled) (JSON.stringify)

formatted date........................................... x 782,367 ops/sec ±1.14% (185 runs sampled) (fast-json-stringify)
formatted date........................................... x 491,574 ops/sec ±5.02% (182 runs sampled) (JSON.stringify)

formatted time........................................... x 790,945 ops/sec ±0.96% (184 runs sampled) (fast-json-stringify)
formatted time........................................... x 533,953 ops/sec ±1.15% (185 runs sampled) (JSON.stringify)

short array of numbers................................... x 56,663 ops/sec ±4.98% (156 runs sampled) (fast-json-stringify)
short array of numbers................................... x 14,718 ops/sec ±3.91% (153 runs sampled) (JSON.stringify)

short array of integers.................................. x 42,258 ops/sec ±4.17% (153 runs sampled) (fast-json-stringify)
short array of integers.................................. x 12,509 ops/sec ±4.34% (148 runs sampled) (JSON.stringify)

Checklist

gurgunday
gurgunday previously approved these changes Mar 11, 2024
Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Member

@ivan-tymoshenko ivan-tymoshenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't modify the existing benchmarks, please. This was designed mainly to compare diff branches between each other. If you need another benchmarks create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants