Skip to content

bench: compare superjson 2.2.3, #364 and devalue interleaved - #1

Open
genesiscz wants to merge 2 commits into
perf/benchmarksfrom
perf/devalue-compare
Open

genesiscz wants to merge 2 commits into
perf/benchmarksfrom
perf/devalue-compare

Conversation

@genesiscz

Copy link
Copy Markdown
Owner

Compares superjson 2.2.3 (the version col-web ships), superjson origin/main, PR ravionhq#364 (perf/faster-serialize) and devalue 6.0.3, interleaved in one browser page. Fork-internal, not for upstream.

Harness: /compare page in benchmarks/compare-app.ts, a devalue adapter in benchmarks/devalue-lib.ts, and a per-feature check in benchmarks/devalue-features.ts. Commands: bun benchmarks/ledger-run.ts --page /compare --throttle 3.79 --repeat 10 --filter "RQ persisted,tRPC-like,1000 users with 2 Dates,deep nested dates,shared refs: 1000" --ops stringify,parse,serialize,deserialize.

Col-web cache fixture, 3.79× CPU, 10 runs, mean ms (speedup vs 2.2.3):

Op 2.2.3 ravionhq#364 devalue
stringify 45.83 10.21 (4.49×) 9.94 (4.61×)
parse 9.12 7.39 (1.23×) 4.69 (1.94×)
serialize 35.25 5.88 (5.99×) 9.91 (3.56×)
deserialize 9.12 5.16 (1.77×) 4.64 (1.96×)

200 cases, unthrottled, one run, geomean speedup vs 2.2.3: ravionhq#364 serialize 3.40×, stringify 2.70×, deserialize 1.88×, parse 1.07×. devalue serialize 2.55×, stringify 3.33×, deserialize 1.37×, parse 1.31×. devalue refuses 5 fixtures (Error objects, class instances, symbols, custom transformers, and a mixed fixture).

Note: errors (200) differs between 2.2.3 and origin/main on deserialize and parse, because ravionhq#354 stopped inventing a cause on Errors.

Adds a /compare page that runs origin/main, perf/faster-serialize and devalue
in the same interleaved rounds. devalue is adapted to the SuperJSON call shape
and checked by round-trip fidelity, because its text differs from superjson's.
Cases devalue refuses (classes, symbols, custom types, Errors, Promises) are
recorded as refused instead of timed. Also adds benchmarks/devalue-features.ts,
a per-feature round-trip table, and devalue as a dev dependency.
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.

1 participant