-
Notifications
You must be signed in to change notification settings - Fork 289
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
Use builtin function names instead of '<builtin function>' #844
Open
vinzenz
wants to merge
2,987
commits into
pyston:master
Choose a base branch
from
vinzenz:builtin-function-names
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
They are tricky since these are types, which means they invoke the relatively-complicated constructor logic. ie str() doesn't just call __str__ on the argument: if the result is a subclass of str, it calls result.__init__(). Similarly for unicode, except unicode is even trickier since it takes some more arguments, one of which is "encoding" which will have non-type-based dynamic behavior. I didn't realize that at first and optimized unicode() by exposing an inner version of it that takes its arguments in registers, which we can take advantage of using our jit-arg-rearrangement capability. This means we have to do parts of PyArg_ParseTuple ourselves, so I added a PyArg_ParseSingle that runs a single object through the arg-conversion code. PyArg_ParseSingle could be further optimized if we want to. Or rather, if we have functions of the form PyArg_ParseSingle_s (which corresponds to the "s" format code) we could skip some more of the overhead. I had to disable most of that once I realized the encoding issue, but I left it in since hopefully we will be able to use it again once we have some "do some guards after mutations if we know how to resume after a failed guard" rewriter support.
callable(), str(), repr(), PySequence_GetItem(), and PyObject_HasAttrString() Mostly by bringing in the CPython versions.
optimize some misc runtime functions
list recursive printing
Previously after doing a OSR JIT compilation we continued to JIT every block outside of the loop. This doesn't show up as a perf change but reduces the number of JITed code / makes it slightly smaller.
The exceptions thrown by len itself can now be either style, though any exceptions thrown by any called functions (ex __len__) will still get thrown as C++ exceptions and converted if needed. Helps in a common case of "try calling len but don't worry if no len was defined".
Numeric binary operator support for old style class
bjit: add support for most common missing nodes and don't JIT compile cold blocks
For use of PyObject_GetItem django_template3 ends up calling this a fair amount via unicode_translate (ie it checks to see if certain entries are in the translation table).
Apparently they can do compile-time evaluations, which is cool.
Fix the errors that report in `test format` and re-enable `test format`.
start templatizing the runtime to be able to choose exception styles
Our exception throwing is still slower than CPython's, and it looks like it's partially due to the CAPI calls we do as part of the throwing process. For example, we have to actually create an exception object, which involves calling the exception type constructor, etc. We could try to jit this stuff, but for now add another fast-path to typeCall that should catch some of this. Also, add a fast-path that inlines most of the exception-creation behavior. Looks like this isn't too much faster than the above-mentioned fast-path.
We're keeping them around anyway
improve getattr() speed
Allow string + bytearray => bytearray. Fixes pyston#780
We currently over-build it quite a bit; I'll try to look into that issue, but for now we can lessen the effects by at least building it in parallel.
Probably more compatible, but also much faster. Also, set str_cls->tp_repr.
make `int("some_random_string")` faster
Improve the float implementation, enable test_float
Microoptimize the rewriter class
Switch our Python set implementation to use a llvm::DenseSet
vinzenz
force-pushed
the
builtin-function-names
branch
from
August 17, 2015 13:49
392ec50
to
06d1ac9
Compare
I just merged #845, does that help? fyi it's difficult to review/merge a PR like this that contains commits from another unmerged PR; I wish github had better support for that but it doesn't :/ |
kmod
force-pushed
the
master
branch
2 times, most recently
from
October 28, 2020 21:01
352fd89
to
6488a3e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.