Open liampauling opened 2 years ago
The parser creates values on the fly, so the best (and i think only) way to currently speed it up is to short circuit the for update in file:
loop, to put it another way, to stop parsing the file when you've got what you need.
The 1 thing that I could potentially add with this info tho, is to convert to a mutable structure when I know you dont want the parsed values, then back to immutable when you do. We know from the bfd impl, that this could provide a roughly 30% speed up for those updates (not having to allocate new memory for every changed Runner/ladder/etc). It would be a significant bit of work and avenue for error however, and a 30% speed up for a few updates might not be worth the effort.
I thought you would say that, how about the option to choose mutability for bflw
and then a copy made only if required for example:
if filter:
yield [market_book.copy()]
I am not sure if this will have any benefit in terms of speed on your implementation however in flumine we have some code which ignores/doesn't output data that doesn't meet user requirements, for example
inplay
andseconds_to_start
.This gets passed down to bflw and has a huge speed improvement to the python code so wondering if it would be the same for betfair_data? Here is the code I have added which does the same but after it has been processed by the Rust code: