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

Use builtin function names instead of '<builtin function>' #844

Open
wants to merge 2,987 commits into
base: master
Choose a base branch
from

Conversation

vinzenz
Copy link
Contributor

@vinzenz vinzenz commented Aug 17, 2015

No description provided.

Daetalus and others added 30 commits July 27, 2015 10:38
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
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
Daetalus and others added 25 commits August 14, 2015 14:21
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
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
Switch our Python set implementation to use a llvm::DenseSet
@vinzenz vinzenz force-pushed the builtin-function-names branch from 392ec50 to 06d1ac9 Compare August 17, 2015 13:49
@kmod
Copy link
Collaborator

kmod commented Aug 17, 2015

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 kmod added the wip label Aug 21, 2015
@kmod kmod force-pushed the master branch 2 times, most recently from 352fd89 to 6488a3e Compare October 28, 2020 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy