baron icon indicating copy to clipboard operation
baron copied to clipboard

Performance question

Open boxed opened this issue 8 years ago • 0 comments

I've recently discovered the newly release library parso that seems to overlap a bit with what baron does (but provides python 3 support!). I prefer the pure dicts/list/etc data structure of baron over the class heavy style of parso, but otherwise they seem similar. A big difference though is speed:

In [1]: len(code)
Out[13]: 501631

In [2]: %timeit code == baron.dumps(baron.parse(code))
1 loop, best of 3: 16.5 s per loop

In [3]: %timeit code == parso.parse(code).get_code()
1 loop, best of 3: 4.46 s per loop

This is a pretty big big file as you can see, and the difference in speed is quite dramatic. Maybe something to look at...

boxed avatar Sep 06 '17 07:09 boxed