We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b455b43 commit 3eb71bbCopy full SHA for 3eb71bb
experiments/traversal-benchmark.py
@@ -128,9 +128,11 @@ def main():
128
t_end = time()
129
print(f"Took: {t_end-t_start} secs.")
130
else:
131
- import vmprof
132
- with open("test.prof", "w+b") as fd:
133
- vmprof.enable(fd.fileno())
+ import pyinstrument
+ from pyinstrument.renderers import SpeedscopeRenderer
+ prof = pyinstrument.Profiler()
134
+ with prof:
135
for _ in range(10_000):
136
main()
- vmprof.disable()
137
+ with open("ss.json", "w") as outf:
138
+ outf.write(prof.output(SpeedscopeRenderer(show_all=True)))
0 commit comments