Skip to content

Conversation

@atuchin-m
Copy link
Collaborator

For brave/brave-browser#50463

The PRs speeds up matching of u64 flat maps by using fb_vector_to_slice(). This allows to use more optimal binary_search (a build it impl that bypasses some unneeded range checks).

url_cosmetic_resources/brave-list
                        time:   [189.73 µs 191.20 µs 193.89 µs]
                 change:
                        time:   [-18.766% -11.801% -4.9190%] (p = 0.00 < 0.05)
                        Performance has improved.

@atuchin-m atuchin-m self-assigned this Oct 30, 2025
@atuchin-m atuchin-m requested a review from a team as a code owner October 30, 2025 19:58
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: 29c19a4 Previous: 1bf068d Ratio
rule-match-browserlike/brave-list 2244639715 ns/iter (± 10425999) 2260065342 ns/iter (± 8732867) 0.99
rule-match-first-request/brave-list 1136202 ns/iter (± 13826) 1127532 ns/iter (± 14737) 1.01
blocker_new/brave-list 182442591 ns/iter (± 2870488) 178507782 ns/iter (± 1633867) 1.02
blocker_new/brave-list-deserialize 23759440 ns/iter (± 60166) 23438268 ns/iter (± 45267) 1.01
memory-usage/brave-list-initial 11499344 ns/iter (± 3) 11499344 ns/iter (± 3) 1
memory-usage/brave-list-initial/max 67489115 ns/iter (± 3) 67489115 ns/iter (± 3) 1
memory-usage/brave-list-initial/alloc-count 1660477 ns/iter (± 3) 1660477 ns/iter (± 3) 1
memory-usage/brave-list-1000-requests 2666926 ns/iter (± 3) 2666926 ns/iter (± 3) 1
memory-usage/brave-list-1000-requests/alloc-count 71337 ns/iter (± 3) 71337 ns/iter (± 3) 1
url_cosmetic_resources/brave-list 202957 ns/iter (± 984) 200630 ns/iter (± 2466) 1.01
cosmetic-class-id-match/brave-list 3346840 ns/iter (± 923965) 3420999 ns/iter (± 962032) 0.98

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

@boocmp boocmp merged commit 7091433 into master Oct 31, 2025
9 checks passed
@boocmp boocmp deleted the speedup-cosmetic-filter-matching branch October 31, 2025 04:29
@atuchin-m atuchin-m added the perf label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants