-
Notifications
You must be signed in to change notification settings - Fork 136
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
Code structure follow up #3. #434
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust Benchmark
Benchmark suite | Current: 29f787f | Previous: 0fe3582 | Ratio |
---|---|---|---|
rule-match-browserlike/brave-list |
1697628006 ns/iter (± 23321845 ) |
1839697309 ns/iter (± 11629260 ) |
0.92 |
rule-match-first-request/brave-list |
1002491 ns/iter (± 20533 ) |
1015644 ns/iter (± 10433 ) |
0.99 |
blocker_new/brave-list |
215643394 ns/iter (± 6381520 ) |
209824147 ns/iter (± 3193249 ) |
1.03 |
memory-usage/brave-list-initial |
41408849 ns/iter (± 3 ) |
41409969 ns/iter (± 3 ) |
1.00 |
memory-usage/brave-list-after-1000-requests |
44004875 ns/iter (± 3 ) |
44005995 ns/iter (± 3 ) |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
README.md
Outdated
The `unsync-regex-caching` feature enable optimizations for rule matching speed and the amount of memory used by the engine. | ||
These features can be disabled to make the engine `Send + Sync`, although it is recommended to only access the engine on a single thread to maintain optimal performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc here should be updated to refer to the feature singularly (i.e. enable
-> enables
, These features
-> This feature
)
src/request.rs
Outdated
@@ -98,15 +100,25 @@ impl Request { | |||
if case_sensitive { | |||
Cow::Borrowed(&self.url) | |||
} else { | |||
Cow::Owned(self.url.to_ascii_lowercase()) | |||
Cow::Borrowed(&self.url_lower_cased) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just return &str
directly instead of Cow
if it's borrowed in all cases
src/request.rs
Outdated
) -> std::iter::Chain< | ||
core::iter::Flatten<std::option::IntoIter<&Vec<utils::Hash>>>, | ||
std::slice::Iter<'_, utils::Hash>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return type of impl Iterator<Item=&utils::Hash>
would be cleaner here
src/request.rs
Outdated
pub hostname: String, | ||
pub request_tokens: Vec<utils::Hash>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make these new fields pub(crate)
, they're an internal implementation detail and we don't want them to be set outside of the constructors
Bench performance has been improved a little.
check
,check_all
functions are simplified.