Skip to content

Reduce some codegen allocations #857

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

Merged
merged 3 commits into from
Aug 22, 2015
Merged

Reduce some codegen allocations #857

merged 3 commits into from
Aug 22, 2015

Conversation

kmod
Copy link
Collaborator

@kmod kmod commented Aug 22, 2015

another one (percent) bites the dust:

           django_template3.py             2.9s (4)             2.9s (2)  -1.2%
                 pyxl_bench.py             2.7s (4)             2.6s (2)  -0.8%
     sqlalchemy_imperative2.py             3.1s (4)             3.0s (2)  -0.8%
                       geomean                 2.9s                 2.9s  -1.0%

kmod added 2 commits August 22, 2015 07:33
Maybe a better overall approach is to not convert it out of its
original flat format; we keep that original memory around anyway
and I don't think it's that much faster to scan than our parsed
version.

But for now, optimize the current approach:
- convert vector->SmallVector
- call ensure since we usually know how many elements the vectors will have
- use a StringMap instead of an unordered_map<std::string>
We were storing and passing them as std::unordered_map (and sometimes
switching to std::vector).  But the set can only contain the integers
0 through 15, so just represent it as a bitset.
kmod added a commit that referenced this pull request Aug 22, 2015
Reduce some codegen allocations
@kmod kmod merged commit 0fc53b7 into pyston:master Aug 22, 2015
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

Successfully merging this pull request may close these issues.

1 participant