mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Update profiling script
This commit is contained in:
parent
850043b49b
commit
364c32fa79
3 changed files with 6 additions and 16 deletions
|
@ -493,11 +493,8 @@ PROFILE_CODE = os.environ.get("ANKI_PROFILE_CODE")
|
||||||
|
|
||||||
def write_profile_results() -> None:
|
def write_profile_results() -> None:
|
||||||
profiler.disable()
|
profiler.disable()
|
||||||
profile = os.path.join(os.environ.get("BUILD_WORKSPACE_DIRECTORY", ""), "anki.prof")
|
profile = "out/anki.prof"
|
||||||
profiler.dump_stats(profile)
|
profiler.dump_stats(profile)
|
||||||
profiler.dump_stats("anki.prof")
|
|
||||||
print("profile stats written to anki.prof")
|
|
||||||
print("use 'bazel run qt:profile' to explore")
|
|
||||||
|
|
||||||
|
|
||||||
def run() -> None:
|
def run() -> None:
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import snakeviz
|
|
||||||
from snakeviz.cli import main
|
|
||||||
|
|
||||||
profile = os.path.join(os.environ["BUILD_WORKSPACE_DIRECTORY"], "anki.prof")
|
|
||||||
sys.argv.append(profile)
|
|
||||||
sys.exit(main())
|
|
5
tools/profile
Executable file
5
tools/profile
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ANKI_PROFILE_CODE=1 ./run
|
||||||
|
out/pyenv/bin/pip install snakeviz
|
||||||
|
out/pyenv/bin/snakeviz out/anki.prof
|
Loading…
Reference in a new issue