-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fixes #1268 and a bug in the values output by VALUESPLIT #1269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes VALUESORT, but this is not efficient for VALUESPLIT.
Splitting a boolean gts do not need to sort input. Just create two empty gts, iterate on each input value to populate these gts, then keep non empty ones.
test code:
NEWGTS
1 1e6 TOLONG <%
'v' STORE
[ $v true ] ADDVALUE
%> FOR
[ NOW false ] ADDVALUE
'input' STORE
'split' CHRONOSTART
$input 'x' VALUESPLIT DROP
'split' CHRONOEND
CHRONOSTATS
(should take 1 second, not 20)
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60ms instead of 28s.
Sorting booleans can be done with the same strategy/code: fast boolean split then merge both. booleanSplit can be a new method in GTSHelper, used by both functions.
takes 150ms (one million value input) (28s for VALUESORT) |
sort is stable, MERGE is not |
No description provided.