From f07b11e27d622e035bd9de79c29af0261fafb728 Mon Sep 17 00:00:00 2001 From: gituser12981u2 Date: Thu, 27 Jun 2024 10:54:55 -0700 Subject: [PATCH] ran a profile --- .gitignore | 3 +++ analyse_profile.py | 20 ++++++++++++++++++++ audio_visualizer/__init__.py | 0 example_config/config.lua | 3 ++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 analyse_profile.py mode change 100644 => 100755 audio_visualizer/__init__.py diff --git a/.gitignore b/.gitignore index c870752..d88ce77 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ coverage.xml .hypothesis/ debug.log +# Performance profile +init_profile.profile + # PyCharm .idea/ diff --git a/analyse_profile.py b/analyse_profile.py new file mode 100644 index 0000000..81fc2b2 --- /dev/null +++ b/analyse_profile.py @@ -0,0 +1,20 @@ +import pstats +import sys + + +def analyze_profile(profile_file): + # Create a Stats object from the profile file + stats = pstats.Stats(profile_file) + + # Sort the statistics by the cumulative time spent in the function + stats.sort_stats('cumulative') + + # Print the ten functions that took the most cumulative time + stats.print_stats(10) + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python analyze_profile.py profile_file") + else: + analyze_profile(sys.argv[1]) diff --git a/audio_visualizer/__init__.py b/audio_visualizer/__init__.py old mode 100644 new mode 100755 diff --git a/example_config/config.lua b/example_config/config.lua index 33dea29..613d443 100644 --- a/example_config/config.lua +++ b/example_config/config.lua @@ -1,8 +1,9 @@ return { key_binds = { -- The modifier key used for hotkeys. Possible values are 'ctrl', 'shift', 'alt'. - -- Note: On macOS, using 'shift or 'alt' can alter teh character keys. + -- Note: On macOS, using 'shift or 'alt' can alter the character keys. -- For example, 'shift' + 'l' becomes 'L', and 'alt' + 'l' might result in a non-alphanumeric character '¬'. + -- 'alt' works best on windows. -- Users should adjust the 'keys' bindings accordingly if using 'shift' or 'alt'. modifier_key = 'ctrl',