Skip to content

Optimize strippingline

Chitsanu Khurewathanakul requested to merge optimize-strippingline into master

The MR applies changes to the function StrippingLine.limitCombinatorics which I found after some profiling that it's the one that consume most time during the instantiation of each line. The function is recursive, so this can go slow very fast if unchecked (pun not intended).

The previous implementation relies on type(configurable) == some_class assertion for each use case. This can be mitigated by comparing the name (string) of the instance's class instead, as well as caching the string. Some reordering of the checklist also gives a speed gain. I've used line_profiler on test_allstreams_instantiation to check the final speed gain, which reduced the time from 77sec to ~2sec. The log file is also attached.

after.txt before.txt test.txt

Merge request reports