-
Notifications
You must be signed in to change notification settings - Fork 0
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
Minimize impact on performance #20
Comments
I did some research into serialization formats and I came to the conclusion that our best option is likely MessagePack. I also considered BSON, ProtoBuf, FlatBuffers and pure JSON. Reasons for MessagePack:
Most obvious question is why not JSON? IMO, JSON is unacceptable because we store a lot of numbers for the Span. Encoding numbers as text is highly inefficient as it take 1 byte per character. The challenge with moving to byte encoding is that I don't know how to represent |
0 or 255 (max byte) |
It will have to be compatible with message pack encoding |
SWC currently emits array literals for s-expressions which seems to be impacting performance, especially when enabling the transformer on node_modules.
To fix, there are various avenues to explore:
JSON.parse
. This is a common technique deployed by bundlers to optimize embedded literal data.function.toString()
- we could even use SWC's JS bindings to do the parsing. This seems to be the most compact form.The text was updated successfully, but these errors were encountered: