Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance question #125

Open
boxed opened this issue Sep 6, 2017 · 0 comments
Open

Performance question #125

boxed opened this issue Sep 6, 2017 · 0 comments

Comments

@boxed
Copy link
Contributor

boxed commented Sep 6, 2017

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant