Commit 43a2906
committed
perf: reduce parallel backtest overhead on Windows/WSL
Pass data_provider_service via ProcessPoolExecutor initializer instead
of pickling it per task submission. On spawn-based systems (Windows/WSL)
this avoids serializing the full data provider (with loaded dataframes)
for every batch — now each worker pickles it only once at startup.
- Add _init_worker() initializer and _worker_data_provider_service global
- Copy data_provider_service once before pool starts
- Worker falls back to module-level global when args value is None
- No behavior change on fork-based systems (macOS/Linux)1 parent a6f4bff commit 43a2906
1 file changed
Lines changed: 38 additions & 3 deletions
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
35 | 50 | | |
36 | 51 | | |
| |||
939 | 954 | | |
940 | 955 | | |
941 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
942 | 964 | | |
943 | 965 | | |
944 | 966 | | |
| |||
949 | 971 | | |
950 | 972 | | |
951 | 973 | | |
952 | | - | |
| 974 | + | |
953 | 975 | | |
954 | 976 | | |
955 | 977 | | |
| |||
979 | 1001 | | |
980 | 1002 | | |
981 | 1003 | | |
982 | | - | |
983 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
984 | 1013 | | |
985 | 1014 | | |
986 | 1015 | | |
| |||
1775 | 1804 | | |
1776 | 1805 | | |
1777 | 1806 | | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
1778 | 1813 | | |
1779 | 1814 | | |
1780 | 1815 | | |
| |||
0 commit comments