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

export some CallContext methods #1083

Closed
rurban opened this Issue Jul 16, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@rurban
Member

rurban commented Jul 16, 2014

Calling CallContext methods internally via the indirect PMC vtable route might be too slow. See http://wknight8111.blogspot.com/2009/10/optimizing-parrot.html

Benchmark this:

  • export the internally needed CallContext vtable methods (not static) and use them in our PCC (src/call/*.c only)
  • add a lib/Parrot/Pmc2c/PMC/CallContext.pm to special case it (if worthwile)
  • inline the CallContext ATTR accessors to omit the obj check, because there cannot be an override for it, or fix the definition in the header itself

i.e.

/* Generated macro accessors for 'arg_flags' attribute of CallContext PMC. */
#define GETATTR_CallContext_arg_flags(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_CallContext_attributes *)PMC_data(pmc))->arg_flags; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "arg_flags")); \
        } \
    } while (0)

=>

#define GETATTR_CallContext_arg_flags(interp, pmc, dest) \
            (dest) = PARROT_CALLCONTEXT(pmc)->arg_flags;

to get benchmark numbers just fix include/pmc/pmc_callcontext.h and src/pmc/callcontext.c manually

@ZYROz ZYROz self-assigned this Jul 16, 2014

rurban pushed a commit that referenced this issue Jul 22, 2014

rurban pushed a commit that referenced this issue Jul 22, 2014

Reini Urban
[pcc] actually use now the direct methods GH #1083
and do not use the CallContext vtable methods anymore.
also inline one Continuation_set_pointer call.

all tests still passing, 2.98% faster.

ZYROz added a commit to ZYROz/parrot that referenced this issue Jul 28, 2014

ZYROz added a commit to ZYROz/parrot that referenced this issue Jul 28, 2014

rurban pushed a commit that referenced this issue Jul 29, 2014

Reini Urban
[pmc2c] WIP - More special-case CallContext, c vs h, GH #1083
put CallContext decl into .h as they are not static.
TODO: one remaining syntax error and missing Parrot_CallContext_class_init

ZYROz added a commit to ZYROz/parrot that referenced this issue Jul 29, 2014

ZYROz added a commit to ZYROz/parrot that referenced this issue Aug 2, 2014

ZYROz added a commit to ZYROz/parrot that referenced this issue Aug 5, 2014

ZYROz added a commit to ZYROz/parrot that referenced this issue Aug 5, 2014

ZYROz added a commit to ZYROz/parrot that referenced this issue Aug 5, 2014

ZYROz added a commit that referenced this issue Aug 5, 2014

[pmc2c] Faster CallContext ATTR accessors + non-static for GH #1083
Omit the obj check in the CallContext ATTR accessors.

Put CallContext non-static decl into .h as they are not static anymore,
so that we can call them now directly internally in src/call/*.c
to avoid VTABLE redirection for those.

work together with Reini Urban

rurban pushed a commit that referenced this issue Aug 5, 2014

Reini Urban
[pcc] use the direct CallContext methods GH #1083
and do not use the CallContext vtable methods anymore.
also inline one Continuation_set_pointer call.

all tests still passing, 2.98% faster.

rurban pushed a commit that referenced this issue Aug 5, 2014

Reini Urban
[pcc] use the direct CallContext methods GH #1083
and do not use the CallContext vtable methods anymore.
also inline one Continuation_set_pointer call.

in fill_params() it is safe to use CallContext directly, as
it assumes either NULL or CallContext, but never PMCNULL.

all tests still passing, 1.63% faster.

ZYROz added a commit that referenced this issue Aug 12, 2014

[pcc] use the direct CallContext methods GH #1083
and do not use the CallContext vtable methods anymore.
also inline one Continuation_set_pointer call.

in fill_params() it is safe to use CallContext directly, as
it assumes either NULL or CallContext, but never PMCNULL.

all tests still passing, 1.63% faster.

Signed-off-by: Reini Urban <rurban@cpanel.net>

rurban pushed a commit that referenced this issue Aug 14, 2014

rurban pushed a commit that referenced this issue Aug 19, 2014

Reini Urban
Release 6.7.0 - Grey-headed Lovebird
This release is still very stable. It adds two code changes:
- find_codepoint: added more name aliases for perl6 (LF,FF,CR and NEL)
- Optimize internal pcc CallContext calls from VTABLE to direct calls
  and inline CallContext ATTR accessors to omit the obj check. [GH #1083]
@rurban

This comment has been minimized.

Show comment
Hide comment
@rurban

rurban Sep 6, 2014

Member

Merged with Release 6.7.0

Member

rurban commented Sep 6, 2014

Merged with Release 6.7.0

@rurban rurban closed this Sep 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment