Skip to content

Navigation Menu

Sign in
Sign up

Use fastjson for faster serialization and deserialization #154

jdgriffith started this conversation in Ideas
Discussion options

I'm curious if there is any consideration for other JSON libraries since the amount of messages and subscriptions you can have with market data can be a firehose.

Here is a benchmark project: https://github.com/fabienrenaud/java-json-benchmark?tab=readme-ov-file

I realize you have to take some benchmarks with some nuance, but I think it's a good heuristic. I opted for fastjson when I was using polygon market data so I could process all the incoming trades as quickly as possible. I was generating my own per second aggregates from trades.

I'm interested to hear other's thoughts and if by chance this is a concern for others.

You must be logged in to vote

Replies: 1 comment

Comment options

This is certainly possible, but most users of this library aren't too concerned with the (slower) performance of Gson (de)serialization compared to other libraries. Some OpenAPI Java generators use Jackson instead of Gson which may yield some performance improvements, but odds are that there are other performance bottlenecks in one's trading system that show up before JSON (de)serialization. Alpaca isn't meant for HFT as well.
Just some thoughts.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /