Skip to content

[Draft] Cosmetic filter fb v3: full migration#497

Closed
atuchin-m wants to merge 2 commits intomasterfrom
cosmetic-filter-fb-v3
Closed

[Draft] Cosmetic filter fb v3: full migration#497
atuchin-m wants to merge 2 commits intomasterfrom
cosmetic-filter-fb-v3

Conversation

@atuchin-m
Copy link
Collaborator

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

DO NOT MERGE

The PR moves from per-NetworkList flatbuffers to a one (per-Engine).
It doesn't affect the performance metrics, but opens 
a possibility to put cosmetic filters to the same flatbuffer.
It also simplifies the serialization/deserialization code.
@atuchin-m atuchin-m self-assigned this Aug 7, 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

Details
Benchmark suite Current: f087a7b Previous: 4738d3f Ratio
rule-match-browserlike/brave-list 2859316369 ns/iter (± 26370025) 2252126465 ns/iter (± 13369021) 1.27
rule-match-first-request/brave-list 1093627 ns/iter (± 7231) 1000284 ns/iter (± 8364) 1.09
blocker_new/brave-list 153748871 ns/iter (± 1079694) 150674514 ns/iter (± 1975624) 1.02
blocker_new/brave-list-deserialize 63334161 ns/iter (± 907905) 62360204 ns/iter (± 1865060) 1.02
memory-usage/brave-list-initial 8803460 ns/iter (± 3) 16225933 ns/iter (± 3) 0.54
memory-usage/brave-list-initial/max 64817626 ns/iter (± 3) 64817658 ns/iter (± 3) 1.00
memory-usage/brave-list-initial/alloc-count 1547531 ns/iter (± 3) 1514650 ns/iter (± 3) 1.02
memory-usage/brave-list-1000-requests 2516439 ns/iter (± 3) 2505592 ns/iter (± 3) 1.00
memory-usage/brave-list-1000-requests/alloc-count 66508 ns/iter (± 3) 66070 ns/iter (± 3) 1.01

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

pub(crate) fn filter_list(&self) -> fb::NetworkFilterList<'_> {
unsafe { fb::root_as_network_filter_list_unchecked(self.data()) }
pub(crate) fn root(&self) -> fb::Engine<'_> {
unsafe { fb::root_as_engine_unchecked(self.data()) }
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_COMPLEX_ID_RULES_INDEX, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_COMPLEX_ID_RULES_VALUES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

None,
)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_HOSTNAME_HIDE_VALUES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_SIMPLE_CLASS_RULES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_SIMPLE_ID_RULES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_MISC_GENERIC_SELECTORS, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_COMPLEX_CLASS_RULES_INDEX, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>,
>>(Engine::VT_COMPLEX_CLASS_RULES_VALUES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: f087a7b Previous: 4738d3f Ratio
rule-match-browserlike/brave-list 2859316369 ns/iter (± 26370025) 2252126465 ns/iter (± 13369021) 1.27

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

@atuchin-m atuchin-m force-pushed the cosmetic-filter-fb-v3 branch from 11e5634 to 62d4b1f Compare August 8, 2025 05:43
flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<NetworkFilterList>>,
>>(Engine::VT_NETWORK_RULES, None)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

None,
)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

None,
)
.unwrap()
}
Copy link

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected 'unsafe' usage, please audit for secure usage

Source: https://semgrep.dev/r/rust.lang.security.unsafe-usage.unsafe-usage


Cc @thypon @kdenhartog

@atuchin-m atuchin-m force-pushed the cosmetic-filter-fb-v3 branch from 62d4b1f to bede9e2 Compare August 8, 2025 08:33
@atuchin-m atuchin-m force-pushed the cosmetic-filter-fb-v3 branch from bede9e2 to f087a7b Compare August 8, 2025 08:45
@atuchin-m atuchin-m closed this Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants