Skip to content

Commit 2256bcc

Browse files
committed
Adds a small script for profiling the performance of the replay parser
1 parent 10bb713 commit 2256bcc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
dist
44
build
55
sc2reader.egg-info
6+
replay_profile
67
PKG-INFO.txt

profile.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import cProfile
2+
from pstats import Stats
3+
4+
import os,sys
5+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
6+
from sc2reader import Replay
7+
8+
9+
cProfile.run("Replay('test_replays/build17811/1.sc2replay')","replay_profile")
10+
stats = Stats("replay_profile")
11+
stats.strip_dirs().sort_stats("time").print_stats(15)

0 commit comments

Comments
 (0)