flozz / rivalcfg

CLI tool and Python library to configure SteelSeries gaming mice
https://flozz.github.io/rivalcfg/
Do What The F*ck You Want To Public License
792 stars 65 forks source link

Improve profile generation. #211

Closed airblast-dev closed 1 year ago

airblast-dev commented 1 year ago

Benefits: Instead of using globals() and filtering the results, this imports the profiles in function and then uses locals(). This adds four benefits.

Tests were measured using timeit comparing the old and new solutions running with numbers set to 1000000. So results are based on 1000000 times of the function being run.

Unit: seconds Python version: 3.11.3 Old results:

New results:

*Edit: Performance numbers, after a reboot, they became much closer. Newer version is still faster even with the imports.

flozz commented 1 year ago

It looks good to me. I will try to merge it tomorrow. Thank you :)

airblast-dev commented 1 year ago

Happy to help!