I created this to test out how good avro, flexbuffers, cbor, msgpack, and others are at:

I haven't written any packer myself so this is an unopinionated test case that test all the packers I could find. I often find the performance results to be somewhat misleading as they only promote themselves, and they only test one specific version of their dependencies and only test in one engine and not the others. I've tried to make this test as fair as possible by using the same data for all packers, and using the same test harness for all packers.

The goal of this was to find a suitable import/export library for things you can store in IndexedDB.

(Click on each ✅ ❌ to see more details)

This is what some libraries are able to structural clone

Conclusions:

To any implementer packing BigInts:
You should not consider it as 64bit value. think of it more like a arbitrary length Uint8array with any length instead, you need to keep track if it's signed or not more manually.
One solutions to this is reading 8 bits at a time, shift the number and then knowing the length of the buffer. (here is one hex solution)
Another solution is to use a varint where 1 bit in each bytes is a continuation

Test performance with real data:

(it will run 1000 times each in a separate worker - one at the time)