Skip to content

Flat container builders #507

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

Open
wants to merge 7 commits into
base: 0.11.x
Choose a base branch
from
Open

Flat container builders #507

wants to merge 7 commits into from

Conversation

atuchin-m
Copy link
Collaborator

@atuchin-m atuchin-m commented Aug 14, 2025

The PR introduces new structures to be used in cosmetic_filters:

  • FlatSerialize trait for things that can be serialized to flatbuffer;
  • Builder structure to help construct a serializable representation + unit tests;
  • Migrate network filter to the new API;
  • Increase MIN_ALIGNMENT to 8 to support using u64 as a key.

@atuchin-m atuchin-m requested a review from boocmp August 14, 2025 11:24
@atuchin-m atuchin-m self-assigned this Aug 14, 2025
Copy link

@github-actions github-actions bot left a 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: 690a3e5 Previous: f15e8a3 Ratio
rule-match-browserlike/brave-list 2225272418 ns/iter (± 10838082) 2229390776 ns/iter (± 17671286) 1.00
rule-match-first-request/brave-list 1001483 ns/iter (± 6215) 994066 ns/iter (± 3696) 1.01
blocker_new/brave-list 146310032 ns/iter (± 1178618) 153266661 ns/iter (± 1659115) 0.95
blocker_new/brave-list-deserialize 60035476 ns/iter (± 524779) 64183570 ns/iter (± 1176166) 0.94
memory-usage/brave-list-initial 17605276 ns/iter (± 3) 17549140 ns/iter (± 3) 1.00
memory-usage/brave-list-initial/max 64817658 ns/iter (± 3) 64817658 ns/iter (± 3) 1
memory-usage/brave-list-initial/alloc-count 1515380 ns/iter (± 3) 1515544 ns/iter (± 3) 1.00
memory-usage/brave-list-1000-requests 2516503 ns/iter (± 3) 2505576 ns/iter (± 3) 1.00
memory-usage/brave-list-1000-requests/alloc-count 66673 ns/iter (± 3) 66123 ns/iter (± 3) 1.01
url_cosmetic_resources/brave-list 209697 ns/iter (± 2863) 209381 ns/iter (± 2760) 1.00
cosmetic-class-id-match/brave-list 4191106 ns/iter (± 1140259) 4318678 ns/iter (± 1180356) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

@atuchin-m atuchin-m force-pushed the flat-containter-builders branch from e74ef6e to 6e0e572 Compare August 14, 2025 12:15
@atuchin-m atuchin-m marked this pull request as ready for review August 14, 2025 17:03
@atuchin-m atuchin-m requested a review from antonok-edm as a code owner August 14, 2025 17:03
Comment on lines -6 to -7
// Should be 4 while we support armv7 and x86_32.
const MIN_ALIGNMENT: usize = 4;
Copy link
Collaborator

Choose a reason for hiding this comment

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

no longer supporting 32-bit architectures at all?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we do. in case the point isn't aligned to 4 bytes it will be aligned manually.

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