Open hpmaxi opened 3 years ago
processOrderbookData is taking ~20ms for auctionId=21 in rinkeby, this could be taking much more with a lot of bids. And runs every time the user change the price amount.
This auction has already 5000 orders. Not sure how bad 20ms are actually in this case.
To improve this is necessary to make some unit testing for the function and his auxiliary functions too. And then find the bottleneck to try to find a faster way to do the same calculations.
Yeah, most likely we are losing time with all the sorting. This seems to be the only expensive function call.
Overall I am not sure whether 20ms are worth the effort. I don't have sufficient experience to judge
processOrderbookData
is taking ~20ms forauctionId=21
in rinkeby, this could be taking much more with a lot of bids. And runs every time the user change the price amount.To improve this is necessary to make some unit testing for the function and his auxiliary functions too. And then find the bottleneck to try to find a faster way to do the same calculations.
What do you think @josojo ?