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

Add more benchmarks for avsc, fury, and msgpackr with the records extension enabled #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

airhorns
Copy link

@airhorns airhorns commented Dec 7, 2024

I am super interested in using Sia in my project, but wanted to compare it against a couple other high-performance serializers:

  • v8's built in serializer on node
  • msgpackr with the records extension enabled, which adds quite a bit of deserialization speed
  • avsc (avro), which also uses a schema known ahead of time to improve speed
  • Apache Fury, which is a very fast serializer in the JVM space that has high performance implementations in JS/Go/Rust etc as well.
  • seqproto which is a low level but high performing serialization toolkit that moves the ordering logic into userland for peak performance.

After adding these, the results on my machine are:

Running serialization benchmark...
┌─────────┬──────────────────────┬──────────────────────┬───────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐
│ (index) │ Task name            │ Latency average (ns) │ Latency median (ns)   │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │
├─────────┼──────────────────────┼──────────────────────┼───────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤
│ 0       │ 'JSON'               │ '7704285.00 ± 0.27%' │ '7577167.00'          │ '130 ± 0.19%'              │ '132'                     │ 2597    │
│ 1       │ 'Sializer'           │ '1137385.94 ± 0.07%' │ '1136375.00'          │ '881 ± 0.06%'              │ '880'                     │ 17585   │
│ 2       │ 'Sializer (v1)'      │ '2507130.97 ± 0.09%' │ '2503250.00'          │ '399 ± 0.06%'              │ '399'                     │ 7978    │
│ 3       │ 'CBOR-X'             │ '3253053.78 ± 0.33%' │ '3194833.00'          │ '310 ± 0.18%'              │ '313'                     │ 6149    │
│ 4       │ 'MsgPackr'           │ '3593255.48 ± 0.29%' │ '3534333.00'          │ '280 ± 0.19%'              │ '283'                     │ 5566    │
│ 5       │ 'MsgPackr (records)' │ '3104918.26 ± 0.30%' │ '3077458.50 ± 41.50'  │ '323 ± 0.11%'              │ '325'                     │ 6442    │
│ 6       │ 'Protobuf'           │ '8334170.44 ± 1.00%' │ '7987083.00 ± 208.00' │ '123 ± 0.41%'              │ '125'                     │ 2400    │
│ 7       │ 'avsc'               │ '3654588.85 ± 0.14%' │ '3641209.00'          │ '274 ± 0.10%'              │ '275'                     │ 5473    │
│ 8       │ 'Fury'               │ '1517067.05 ± 0.24%' │ '1492958.00'          │ '662 ± 0.07%'              │ '670'                     │ 13184   │
│ 9       │ 'SeqProto'           │ '2302592.68 ± 0.73%' │ '1902812.00 ± 21.00'  │ '483 ± 0.64%'              │ '526'                     │ 8686    │
│ 10      │ 'V8'                 │ '2168308.08 ± 3.97%' │ '1340020.50 ± 20.50'  │ '683 ± 0.58%'              │ '746'                     │ 9224    │
└─────────┴──────────────────────┴──────────────────────┴───────────────────────┴────────────────────────────┴───────────────────────────┴─────────┘
Running deserialization benchmark...
┌─────────┬──────────────────────┬──────────────────────┬───────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐
│ (index) │ Task name            │ Latency average (ns) │ Latency median (ns)   │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │
├─────────┼──────────────────────┼──────────────────────┼───────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤
│ 0       │ 'JSON'               │ '1695794.83 ± 0.37%' │ '1614000.00'          │ '600 ± 0.18%'              │ '620'                     │ 11794   │
│ 1       │ 'Sializer'           │ '1183174.41 ± 0.20%' │ '1119667.00'          │ '855 ± 0.15%'              │ '893'                     │ 16904   │
│ 2       │ 'Sializer (v1)'      │ '1763898.19 ± 0.11%' │ '1723875.00'          │ '569 ± 0.10%'              │ '580'                     │ 11339   │
│ 3       │ 'CBOR-X'             │ '2411500.90 ± 0.18%' │ '2372520.50 ± 20.50'  │ '416 ± 0.11%'              │ '421'                     │ 8294    │
│ 4       │ 'MsgPackr'           │ '2596956.36 ± 0.19%' │ '2541437.50 ± 20.50'  │ '387 ± 0.14%'              │ '393'                     │ 7702    │
│ 5       │ 'MsgPackr (records)' │ '1186855.30 ± 0.13%' │ '1147000.00'          │ '848 ± 0.12%'              │ '872'                     │ 16852   │
│ 6       │ 'Protobuf'           │ '2920781.36 ± 0.16%' │ '2989625.00 ± 375.00' │ '344 ± 0.15%'              │ '334'                     │ 6848    │
│ 7       │ 'avsc'               │ '1914623.65 ± 0.16%' │ '1868792.00'          │ '525 ± 0.13%'              │ '535'                     │ 10446   │
│ 8       │ 'Fury'               │ '2168721.97 ± 0.90%' │ '1689834.00'          │ '512 ± 0.52%'              │ '592'                     │ 9223    │
│ 9       │ 'SeqProto'           │ '1853826.48 ± 0.24%' │ '1795583.00'          │ '544 ± 0.15%'              │ '557'                     │ 10789   │
│ 10      │ 'V8'                 │ '2242220.56 ± 0.84%' │ '1742938.00 ± 21.00'  │ '487 ± 0.51%'              │ '574'                     │ 8920    │
└─────────┴──────────────────────┴──────────────────────┴───────────────────────┴────────────────────────────┴───────────────────────────┴─────────┘

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.

None yet

1 participant