Skip to content

Commit 73111cf

Browse files
committed
Add script for profiling the generate process.
1 parent 41a3356 commit 73111cf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

scripts/profile_generate.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
from logya.generate import Generate
4+
5+
import cProfile, pstats, io
6+
from pstats import SortKey
7+
8+
9+
pr = cProfile.Profile()
10+
pr.enable()
11+
12+
Generate(verbose=True)
13+
14+
pr.disable()
15+
s = io.StringIO()
16+
ps = pstats.Stats(pr, stream=s).sort_stats(SortKey.CUMULATIVE)
17+
ps.print_stats()
18+
print(s.getvalue())

0 commit comments

Comments
 (0)