Skip to content

Conversation

@undingen
Copy link
Contributor

                                   upstream/master:      origin/pyxl2_2:
           django_template3.py             2.2s (4)             2.2s (2)  +0.7%
                 pyxl_bench.py             1.8s (4)             1.8s (2)  +0.4%
     sqlalchemy_imperative2.py             2.3s (4)             2.3s (2)  -0.2%
                pyxl_bench2.py             1.3s (4)             1.3s (2)  -1.3%
       django_template3_10x.py            14.2s (4)            14.4s (2)  +0.9%
             pyxl_bench_10x.py            14.3s (4)            14.2s (2)  -0.4%
 sqlalchemy_imperative2_10x.py            17.5s (4)            17.4s (2)  -0.5%
            pyxl_bench2_10x.py            12.2s (4)            11.5s (2)  -5.5%
                       geomean                 5.2s                 5.1s  -0.8%

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need to make this rewrite_args = NULL instead, since it's not clearing a potential capi exception. I'm surprised that the change you made here helped, since I would have thought these guards would cause the rewrite to abort anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It rewrites the case where we run into this case inside getattrInternalGeneric:

if (unlikely(rewrite_args && !descr && obj->cls != instancemethod_cls
         && rewrite_args->rewriter->aggressiveness() < 40
         && attr->interned_state == SSTATE_INTERNED_IMMORTAL)) {
    class Helper {
    public:
        static Box* call(Box* obj, BoxedString* attr) { return obj->getattr(attr); }
    };

    RewriterVar* r_rtn = rewrite_args->rewriter->call(
        false, (void*)Helper::call, rewrite_args->obj,
        rewrite_args->rewriter->loadConst((intptr_t)attr, Location::forArg(1)));
    rewrite_args->setReturn(r_rtn, ReturnConvention::NOEXC_POSSIBLE);
    return Helper::call(obj, attr);
}

the call is marked as having no side effects to the additional guard don't abort the rewrite.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ok, right :)

kmod added a commit that referenced this pull request Oct 28, 2015
Misc pyxl2 perf improvements continued
@kmod kmod merged commit 209350e into pyston:master Oct 28, 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.

2 participants