Closed xiangsf closed 2 years ago
The author of skiplist actually writes on its github repo that pyskiplist is deprecated by SortedContainers, which are faster and have smaller memory footprint.
Does your implementation store only 20 price levels? That could lead to inconsistent orderbook after a few diff updates. It would also explain better performance.
closing as "wont do". If someone wants to open a PR with extensive tests and performance metrics, I might consider merging it, but I wont be doing this work
Is your feature request related to a problem? Please describe. currently, this library use python SortedDict to store orderbook data。 when fetch coinbase、btc-usd data, in l2_book/l3_book callback functions, book.book.bids.index(0)/book.book.asks.index(0) will cost 40%-50% cpu
Describe the solution you'd like use skiplist to store orderbook, only use 10% cpu all test code in this zip file. skiplist.zip
Additional context test code1, python sorteddict use 43% cpu
test code2, skiplist use 9.6% cpu
skiplist impl