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

Sketch transients for HAMT-based data-structures #208

Merged
merged 7 commits into from
May 25, 2022
Merged

Conversation

arximboldi
Copy link
Owner

This PR is the first step towards the full implementation of transients for all HAMT-based data-structures: map and set.

In this PR we do define the interface in two modes:

  • Using the special types map_transient and set_transient, which define a mutable interface (similar to the case of vector_transient and alike). This is required to benefit from the optimizations brought about by transients when using a tracing garbage collector.
  • Using std::move(x)... when performing an operation on an immutable map. This will incur in the same performance benefit as the former when using reference counting for garbage collection (default) and is the recommended way to benefit from it.

In this PR we define and test the interface. We also include the new interface as part of the existing benchmarks for HAMT insertion. The implementation is however naive, this is, it is based on the purely immutable counterpart, an provides no performance benefit. We will explore different alternatives for optimization in subsequent PRs.

Issue #82

PING @omer-s @harryhk from Meta Inc. who is sponsoring this HAMT-transient implementation project!

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2022

Codecov Report

Merging #208 (2232315) into master (b38c67b) will increase coverage by 0.22%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   91.48%   91.70%   +0.22%     
==========================================
  Files         104      108       +4     
  Lines        9790    10062     +272     
==========================================
+ Hits         8956     9227     +271     
- Misses        834      835       +1     
Impacted Files Coverage Δ
extra/fuzzer/fuzzer_input.hpp 95.45% <ø> (ø)
test/flex_vector/fuzzed-0.cpp 100.00% <ø> (ø)
test/flex_vector/fuzzed-1.cpp 94.44% <ø> (ø)
test/flex_vector/fuzzed-2.cpp 100.00% <ø> (ø)
test/flex_vector/fuzzed-3.cpp 100.00% <ø> (ø)
test/flex_vector/fuzzed-4.cpp 100.00% <ø> (ø)
immer/map.hpp 97.75% <100.00%> (-0.17%) ⬇️
immer/map_transient.hpp 100.00% <100.00%> (ø)
immer/set.hpp 100.00% <100.00%> (ø)
immer/set_transient.hpp 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b38c67b...2232315. Read the comment docs.

@arximboldi arximboldi merged commit e374403 into master May 25, 2022
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.

None yet

2 participants