-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add mypy_types benchmark #102
Conversation
Huh, I forgot that mypy doesn't support pypy due to dependence on CPython AST. I wonder if there's a way to skip installation of mypy and this specific benchmark just for pypy? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try not not add the benchmark to DEFAULT_GROUP if you are running PyPy?
e470569
to
8514a2a
Compare
Yay the tests are finally passing! This should ready for review now. Please take a look when you have the time Victor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @ericsnowcurrently take note!
Recently I remembered mypy uses mypyc for speedups. I'm inclined to pass Though I'm not sure how to pass in that argument just for mypy. Seems like |
I just was reminded of this PR again. Do we still need to do this when we have Eric's more general #109?
Oh, definitely. Benchmarking mypy with mypyc's speedups says more about mypyc than about the Python interpreter used to run it.
Maybe #109 will help there too? It has a separate toml file per benchmark. I believe Eric also has prepared mods for the Pyston benchmarks that makes them runnable with his new infrastructure; I think it would be a shame if the Pyston benchmarks were forked. We should probably talk to the Pyston team about this before proceeding (@kmod, @undingen). |
@@ -24,6 +24,10 @@ markupsafe==1.1.1 | |||
# via mako | |||
mpmath==1.2.1 | |||
# via sympy | |||
mypy-extensions==0.4.3 | |||
# via mypy | |||
mypy==0.812 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably going to pick up the extension if the wheel is available and the pure python if not, which may give different numbers in different versions. Am I mistaken? Maybe I am missing something.
Edit: I saw this is being discussed already on the PR.
Eric's solution is definitely technically superior (I'm a big fan of his work in that PR). This PR still serves a purpose in adding I'm not sure how |
If you really don't want to measure the C implementation of mypy, the benchmark should have an option to decide which implementations is taken. See for example pyperformance/benchmarks/bm_pickle.py which implements such option and raises an error if it gets the wrong implementation. |
fwiw in Pyston we run the benchmark without mypyc, but get that not 100% by choice because only the prebuilt mypy wheels are built with mypyc and building a fresh wheel yourself (like we need to do) will not use it. |
FYI, I've merged my PR that allows running benchmarks that aren't part of pyperformance. I also have a PR up against the Pyston benchmarks repo to allow them to be run using pyperformance: pyston/python-macrobenchmarks#3. |
@ericsnowcurrently awesome! I'll close this PR then since Pyston has the same. |
Fixes #35. Ported from Pyston.