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

Improved CHAMP map #2894

Merged
merged 13 commits into from
Oct 11, 2018
Merged

Improved CHAMP map #2894

merged 13 commits into from
Oct 11, 2018

Conversation

Theodus
Copy link
Contributor

@Theodus Theodus commented Oct 4, 2018

This PR includes modifications to the persistent hash map which have also resulted in a fix for #2866. The improvements include removing the U8 level field from all nodes and applying full CHAMP compression to the entries at each node.

@Theodus
Copy link
Contributor Author

Theodus commented Oct 4, 2018

The new benchmarks are showing a slight improvement on lookup, and a larger improvement for iteration. However, there is a concerning increase in update times.

Old HashMap:

Benchmark                                   mean            median   deviation  iterations
apply 0 size 1024                         132 ns            132 ns      ±0.56%     1000000
apply 4 size 1024                         154 ns            154 ns      ±0.38%     1000000
apply 17 size 1024                        146 ns            146 ns      ±0.78%     1000000
apply 21 size 1024                        167 ns            167 ns      ±0.36%     1000000
apply 24 size 1024                        205 ns            205 ns      ±0.63%      500000
apply 30 size 1024                        173 ns            174 ns      ±0.70%     1000000
insert 0 size 1024                        306 ns            307 ns      ±0.69%      500000
insert 4 size 1024                        390 ns            390 ns      ±1.29%      300000
insert 17 size 1024                       321 ns            321 ns      ±0.50%      500000
insert 21 size 1024                       403 ns            403 ns      ±0.66%      300000
insert 24 size 1024                       573 ns            573 ns      ±1.22%      200000
insert 30 size 1024                       401 ns            401 ns      ±0.59%      300000
update 0 size 1024                        314 ns            314 ns      ±0.57%      500000
update 4 size 1024                        402 ns            402 ns      ±0.78%      300000
update 17 size 1024                       333 ns            333 ns      ±0.45%      500000
update 21 size 1024                       405 ns            405 ns      ±0.60%      300000
update 24 size 1024                       564 ns            565 ns      ±0.50%      200000
update 30 size 1024                       418 ns            419 ns      ±0.57%      300000
iter size 32                             3971 ns           3976 ns      ±0.87%       30000
iter size 1024                         209640 ns         209686 ns      ±0.44%        1000
iter size 32768                      25381650 ns       25368571 ns      ±4.16%           5

New HashMap:

Benchmark                                   mean            median   deviation  iterations
apply 0 size 1024                         132 ns            130 ns      ±0.37%     1000000
apply 4 size 1024                         152 ns            152 ns      ±0.26%     1000000
apply 17 size 1024                        149 ns            149 ns      ±0.35%     1000000
apply 21 size 1024                        165 ns            165 ns      ±0.49%     1000000
apply 24 size 1024                        200 ns            200 ns      ±0.54%      500000
apply 30 size 1024                        166 ns            165 ns      ±0.90%     1000000
insert 0 size 1024                        440 ns            441 ns      ±0.81%      300000
insert 4 size 1024                        573 ns            573 ns      ±0.50%      300000
insert 17 size 1024                       460 ns            458 ns      ±1.50%      300000
insert 21 size 1024                       584 ns            583 ns      ±0.37%      200000
insert 24 size 1024                       795 ns            795 ns      ±0.45%      200000
insert 30 size 1024                       516 ns            516 ns      ±0.49%      300000
update 0 size 1024                        435 ns            436 ns      ±0.74%      300000
update 4 size 1024                        503 ns            503 ns      ±0.63%      300000
update 17 size 1024                       464 ns            463 ns      ±1.26%      300000
update 21 size 1024                       539 ns            536 ns      ±1.27%      300000
update 24 size 1024                       689 ns            690 ns      ±0.69%      200000
update 30 size 1024                       541 ns            541 ns      ±0.57%      300000
iter size 32                             4267 ns           4273 ns      ±0.71%       30000
iter size 1024                         193530 ns         193667 ns      ±0.47%        1000
iter size 32768                      18047602 ns       17822185 ns      ±3.75%          10

@SeanTAllen
Copy link
Member

@Theodus do the tests you are doing specifically prove that the bug has been fixed? If not, can you add a test that specifically covers #2866?

As this does more than 1 thing, can you add a change log entry to both Fixed and Changed?

@Theodus
Copy link
Contributor Author

Theodus commented Oct 5, 2018

@SeanTAllen done and done

@SeanTAllen SeanTAllen merged commit 6c2d640 into ponylang:master Oct 11, 2018
@SeanTAllen
Copy link
Member

Merged!

@SeanTAllen
Copy link
Member

@Theodus can you add release notes for this?

@mfelsche
Copy link
Contributor

It should be noted that this also affects the persistent Set as it is based on HashMap

@Theodus Theodus deleted the champ branch October 12, 2018 22:54
@Theodus
Copy link
Contributor Author

Theodus commented Oct 12, 2018

Realease Notes

The persistent HashMap and HashSet have reduced memory consumption and improved iteration performance. This change also includes a bug fix related to searching for nonexistent entries and incorrect CHAMP compression.

@SeanTAllen

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.

3 participants