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

Update the benchmarks #491

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,21 +641,21 @@ Notice that several types can take advantage of a more compact representation wh

## Benchmarks

We have coarse-grained benchmarks [here](https://github.com/stepchowfun/typical/tree/main/benchmarks) for each code generator. The data below were averaged over 3 runs on a 2022 MacBook Air with the Apple M2 chip and 8 GB of RAM. The Rust benchmark was compiled by Rust 1.69.0 with `--release`. The TypeScript benchmark was transpiled to JavaScript by TypeScript 4.5.5 and run with Node.js 18.16.0.
We have coarse-grained benchmarks [here](https://github.com/stepchowfun/typical/tree/main/benchmarks) for each code generator. The data below were averaged over 3 runs on a 2023 MacBook Pro with the Apple M2 Max chip and 32 GiB of RAM. The Rust benchmark was compiled by Rust 1.79.0 with `--release`. The TypeScript benchmark was transpiled to JavaScript by TypeScript 4.5.5 and run with Node.js 18.17.0.

One benchmark serializes and deserializes a large message containing several hundred megabytes of text:

| | Rust | TypeScript |
| ----------------------------------- | ----------- | ----------- |
| **Per-thread serialization rate** | 7.258 GiB/s | 3.345 GiB/s |
| **Per-thread deserialization rate** | 2.141 GiB/s | 2.408 GiB/s |
| | Rust | TypeScript |
| ----------------------------------- | ------------ | ------------ |
| **Per-thread serialization rate** | 11.663 GiB/s | 11.092 GiB/s |
| **Per-thread deserialization rate** | 6.030 GiB/s | 7.915 GiB/s |

Another benchmark repeatedly serializes and deserializes a pathological message containing many small and deeply nested values:

| | Rust | TypeScript |
| ----------------------------------- | ------------- | ------------ |
| **Per-thread serialization rate** | 632.890 MiB/s | 42.953 MiB/s |
| **Per-thread deserialization rate** | 205.773 MiB/s | 2.061 MiB/s |
| **Per-thread serialization rate** | 688.198 MiB/s | 48.992 MiB/s |
| **Per-thread deserialization rate** | 290.701 MiB/s | 2.341 MiB/s |

These benchmarks represent two extremes. Real-world performance will be somewhere in the middle.

Expand Down