gnosis / ido-ux

Interface for the ido-platform
GNU General Public License v3.0
25 stars 22 forks source link

processOrderBookData tests & performance #515

Open hpmaxi opened 3 years ago

hpmaxi commented 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.

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 ?

josojo commented 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