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

export some CallContext methods #1083

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

export some CallContext methods #1083

rurban opened this issue Jul 16, 2014 · 1 comment
Assignees

Comments

@rurban
Copy link
Member

@rurban 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
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
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 that referenced this issue Aug 5, 2014
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
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
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
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
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
Copy link
Member Author

@rurban 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.