Avoid linecache unique file generation in case of linecache disabled#461
Avoid linecache unique file generation in case of linecache disabled#461Tinche merged 3 commits intopython-attrs:23.2from
Conversation
|
@sahu-sunil cool, I can merge this in. Does it fix your actual problem though? You can install from this branch and test. If not I can try applying more optimizations. |
|
Yes it was bit helpful but in long duration CPU is still gradually increasing. I am confident that this is due to Yes, please check if you see some scope of optimisation on repeated compilation |
|
@sahu-sunil Ok, let's merge this in and I can take a look at a bigger optimization. Can you just add a short line to HISTORY.md? |
|
Thanks, I'll ping you when I have something more. |
I tried with this locally and the cpu is stable now. Will see if I can find all the places where linecache can be disabled. I know it won't be feasible to reverse on cattrs level, like I did locally |
When cattrs' converter/hooks or same classes are created too frequent or in large amount,
generate_unique_filename(generation of unique file with uuid) becomes slow/inefficient even iflinecacheflag is disabled.This PR executes this function only when cache is enabled. More optimisation can be done for compilation of same classes repeatably, as mentioned in below issue.
Issue discussion: #445