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

cache_map: speed up fuzzing #1904

Merged
merged 2 commits into from
May 2, 2024
Merged

cache_map: speed up fuzzing #1904

merged 2 commits into from
May 2, 2024

Conversation

matklad
Copy link
Member

@matklad matklad commented May 1, 2024

HashMap model doesn't support scopes in an efficient manner. Use HashMap + UndoLog to fix this.

The following seed now finishes in 5 seconds in debug

Seed: ./zig/zig build fuzz -- --seed=5311370176449483187 lsm_cache_map

Comment on lines 274 to 280
fn copy_hash_map(dst: *Map, src: *Map) !void {
dst.clearRetainingCapacity();
var it = src.iterator();
while (it.next()) |kv| {
try dst.putNoClobber(kv.key_ptr.*, kv.value_ptr.*);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded now, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, fixed, and also sneaked in some zebra stripes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_20240502_110903

just so the latest commit is clearly visible

@cb22
Copy link
Contributor

cb22 commented May 1, 2024

Slightly better than my copy-the-entire hash map 😄

matklad added 2 commits May 2, 2024 10:52
HashMap model doesn't support scopes in an efficient manner.
Use HashMap + UndoLog to fix this.

The following seed now finishes in 5 seconds in debug

Seed: ./zig/zig build fuzz --  --seed=5311370176449483187 lsm_cache_map
@matklad matklad force-pushed the matklad/fuzz-cachemap branch from 72111f9 to 46026a8 Compare May 2, 2024 10:06
@matklad matklad enabled auto-merge May 2, 2024 10:17
@matklad matklad added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit d7cebd6 May 2, 2024
25 checks passed
@matklad matklad deleted the matklad/fuzz-cachemap branch May 2, 2024 12:44
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