-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moves pricelog reader into Process/Q
reads a bunch of gziped lines, splits them into symbol, date, price discarding what we don't care about and batch places those values into a shared Q. This shaves a cpl of seconds out of a backtesting run, but also shrinks RAM usage down from 700MB to about 70MB. There is still a significant pause in processing lines, due to the batch size in the reader process, the time it takes to split, and the time to pickle items into the Q. A trial and error led me to 128K as a good compromise between speed and cpu usage (~3%) There is room for optimization, maybe look into 0mq or async gzip readers, or Queue read pooling if that's an option. Needs profiling, likely the split_line is still the cause of the processing pauses.
- Loading branch information
Showing
3 changed files
with
52 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,5 @@ websockets==9.1 | |
Werkzeug==2.2.2 | ||
yarl==1.8.2 | ||
zipp==3.8.1 | ||
faster-fifo==1.4.2 | ||
Cython==0.29.32 |