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 qrpa approach for ResizablePMCArray, add offset attr #1152
Comments
rurban
pushed a commit
that referenced
this issue
Nov 27, 2014
offset is still const 0. so the current PMCNULL error is in some incorrect refactoring.
rurban
pushed a commit
that referenced
this issue
Nov 27, 2014
using a max offset 8, as in nqp/qrpa. See GH #1152 Here offset is still const 0.
rurban
pushed a commit
that referenced
this issue
Nov 28, 2014
resizablepmcarray shift,unshift,resize,push,pop look now good. just splice is missing.
rurban
pushed a commit
that referenced
this issue
Nov 28, 2014
Not offset optimized yet. It still fails. GH #1152
rurban
pushed a commit
that referenced
this issue
Nov 30, 2014
resizablepmcarray shift,unshift,resize,push,pop look now good. just splice is missing. GH #1152
rurban
pushed a commit
that referenced
this issue
Nov 30, 2014
Not offset optimized yet. And something still fails. GH #1152
rurban
pushed a commit
that referenced
this issue
Dec 2, 2014
using a max offset 8, as in nqp/qrpa. See GH #1152 Here offset is still const 0.
rurban
pushed a commit
that referenced
this issue
Dec 2, 2014
resizablepmcarray shift,unshift,resize,push,pop look now good. just splice is missing. GH #1152
rurban
pushed a commit
that referenced
this issue
Dec 2, 2014
Not offset optimized yet. And something still fails. GH #1152
rurban
pushed a commit
that referenced
this issue
Dec 4, 2014
using a max offset 8, as in nqp/qrpa. See GH #1152 Here offset is still const 0.
rurban
pushed a commit
that referenced
this issue
Dec 4, 2014
resizablepmcarray shift,unshift,resize,push,pop look now good. just splice is missing. GH #1152
rurban
pushed a commit
that referenced
this issue
Dec 4, 2014
Not offset optimized yet. And something still fails. GH #1152
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i.e. use a moving array start index (=offset) and move this on shift, unshift or delete[0], instead of moving all array elements around.
just with consistent naming of the attributes. (ssize -> threshold, start -> offset, elems -> size, slots -> array)
qpra from nqp is much faster for the common shift and unshift ops. See http://irclog.perlgeek.de/perl6/2012-06-03/text
O(1) vs O(n), skipping a big memmove for 7 of 8 cases.
With this qrpa might be not needed anymore, esp. with its problems with sort within
threaded proxy pmcs.
Advantages over qrpa:
Disadvantages over old rpa's:
It's 15-25% faster in https://github.com/parrot/parrot-bench, 25% on slow machines, 15% on fast ones.
Further ideas:
We could add the following optimization thresholds:
we could check alignment inside unshift, which is better than in resize.
The text was updated successfully, but these errors were encountered: