Conversation
| let map = Rc::new(map); | ||
| group.bench_function("Rust", |b| { | ||
| b.iter_batched( | ||
| || map.clone(), | ||
| |map| { | ||
| map.lending_iter_prefix(&pattern).for_each(|entry| { | ||
| black_box(entry); | ||
| }); | ||
| }, | ||
| BatchSize::LargeInput, | ||
| ); | ||
| }); |
There was a problem hiding this comment.
| let map = Rc::new(map); | |
| group.bench_function("Rust", |b| { | |
| b.iter_batched( | |
| || map.clone(), | |
| |map| { | |
| map.lending_iter_prefix(&pattern).for_each(|entry| { | |
| black_box(entry); | |
| }); | |
| }, | |
| BatchSize::LargeInput, | |
| ); | |
| }); | |
| group.bench_function("Rust", |b| { | |
| b.iter(|| { | |
| map.lending_iter_prefix(&pattern).for_each(|entry| { | |
| black_box(entry); | |
| }) | |
| }) | |
| }); |
We can use iter directly ^ whenever the benchmark is immutable, thus avoiding the Rc workaround.
| b.iter_batched( | ||
| || map.clone(), | ||
| |map| { | ||
| let pat: &[u8] = unsafe { std::mem::transmute(&*pattern) }; |
There was a problem hiding this comment.
Wouldn't as_bytes do the trick here?
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Moves the bindings to `redismodule.h` in the newly created `redis_modules_test`, along with the Redis allocator shims and a number of utilities. This allows for reusing them in tests outside of `trie_bencher`.
`TrieMap_Iterate` is implemented by applying different iterator adaptors to `trie_rs::iter::LendingIter`, based on the passed iteration mode. `TrieMapIterator_Next` simply obtains the next value from the iterator, and `TrieMapIterator_NextContains` and `TrieMapIterator_NextWildcard` deletage to `TrieMapIterator_Next`. This commit furthermore adds a number of tests to validate the correct operation of the triemap iterator functionality exposed in the `trie_rs::ffi` module. This commit also removes the global allocator definition set in `trie_rs`, as it hinders tests and is to be moved to a façade crate.
Add support for backtracking in `wildcard::TokenStream::matches`, based on the iterate algorithm described by [Dogan Kurt] [Dogan Kurt]: http://dodobyte.com/wildcard.html
Add proptests for the `wildcard::TokenStream::matches` method. One generates random patterns and keys, and validates that the keys match the patterns if and only if the [reference crate]'s implementation matches. The second one constructs keys that match the pattern and validates that they match. [reference crate]: https://github.com/cloudflare/wildcard/
Implement TriMap_IterateRange, and add a test
Implement TrieMap_RandomValueByPrefix and add a test
7e44c3a to
f53d155
Compare
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
fc175ea to
0231743
Compare
0231743 to
5fe979f
Compare
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
55e0c91 to
89cd827
Compare
To do:
Describe the changes in the pull request
A clear and concise description of what the PR is solving, including:
Which additional issues this PR fixes
Main objects this PR modified
Mark if applicable