adshao / go-binance

A Go SDK for Binance API
MIT License
1.54k stars 676 forks source link

speed up json processing #375

Closed Sagleft closed 2 years ago

Sagleft commented 2 years ago

Here is a speed comparison between the standard library and jsoniter: image

Their interfaces are compatible, they perform the same role, but jsoniter is faster than the standard library. This is important because there is a lot of interaction built on the processing of json data from the exchange. Therefore, I propose to reduce the load on the CPU by simply replacing the library.

go test result:

0 0
1629771130463 1629771130463
PASS
ok      github.com/adshao/go-binance/v2 0.089s
adshao commented 2 years ago

@Sagleft great work, it's a huge performance improvement!