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

Implement performance improvements using bit masking #50

Merged
merged 1 commit into from
Mar 4, 2020
Merged

Conversation

sjkelly
Copy link
Member

@sjkelly sjkelly commented Feb 14, 2020

The chief suspect in allocation (and triggering GC) was all the small arrays allocated
to handle ambiguous cases. With this solution we use the 5th bit (0x10) to indicate
an ambiguous case. The logic to disambiguate is handled in the processing of crossings.
This significantly reduces memory allocations and yields modest performance improvements.

This is a cleaned up version of #49 without the hashing hacks.

Memory: 2.22Mb -> 985Kb
Allocations: 21,188 -> 1,189
Net performance gain: ~25%

…culation

The chief suspect in allocation (and triggering GC) was all the small arrays allocated
to handle ambiguous cases. With this solution we use the 5th bit (0x10) to indicate
an ambiguous case. The logic to disambiguate is handled in the processing of crossings.
This significantly reduces memory allocations and yields modest performance improvements.
@sjkelly sjkelly requested a review from SimonDanisch February 14, 2020 01:53
@sjkelly sjkelly mentioned this pull request Feb 14, 2020
@sjkelly
Copy link
Member Author

sjkelly commented Mar 3, 2020

@SimonDanisch @tomasaschan I have tested this with the MakieGallery regression suite and all looks good. I plan to merge later this week if there are no objections.

@sjkelly sjkelly merged commit a710315 into master Mar 4, 2020
@sjkelly sjkelly deleted the sjk/lut2 branch March 4, 2020 01:07
sjkelly added a commit that referenced this pull request Mar 4, 2020
sjkelly added a commit that referenced this pull request Mar 10, 2020
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