Skip to content

Conversation

@atuchin-m
Copy link
Collaborator

@atuchin-m atuchin-m commented Oct 20, 2025

The PR:

  • fixes decode_script_with_permission issues with some PermissionMask;
  • exposes ResourceImpl and EngineDebugInfo.

P.S. the perf issue with blocker_new/brave-list-deserialize isn't relevant (checked locally). It's likely a fast runner was used for reference.

@atuchin-m atuchin-m requested a review from boocmp October 20, 2025 11:24
@atuchin-m atuchin-m self-assigned this Oct 20, 2025
@atuchin-m atuchin-m requested a review from a team as a code owner October 20, 2025 11:24
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: 2c4a433 Previous: 71a1a48 Ratio
rule-match-browserlike/brave-list 2271643196 ns/iter (± 14735781) 2238088933 ns/iter (± 14469145) 1.01
rule-match-first-request/brave-list 1121225 ns/iter (± 8517) 1115051 ns/iter (± 24675) 1.01
blocker_new/brave-list 152141429 ns/iter (± 1011080) 153552333 ns/iter (± 606844) 0.99
blocker_new/brave-list-deserialize 23077399 ns/iter (± 52090) 23594962 ns/iter (± 54120) 0.98
memory-usage/brave-list-initial 11315143 ns/iter (± 3) 11287711 ns/iter (± 3) 1.00
memory-usage/brave-list-initial/max 66961309 ns/iter (± 3) 66961277 ns/iter (± 3) 1.00
memory-usage/brave-list-initial/alloc-count 1635306 ns/iter (± 3) 1635258 ns/iter (± 3) 1.00
memory-usage/brave-list-1000-requests 2562825 ns/iter (± 3) 2562777 ns/iter (± 3) 1.00
memory-usage/brave-list-1000-requests/alloc-count 69292 ns/iter (± 3) 69244 ns/iter (± 3) 1.00
url_cosmetic_resources/brave-list 196947 ns/iter (± 825) 195856 ns/iter (± 597) 1.01
cosmetic-class-id-match/brave-list 3396292 ns/iter (± 943684) 3422837 ns/iter (± 951785) 0.99

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

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: e045807 Previous: 71a1a48 Ratio
blocker_new/brave-list-deserialize 28229342 ns/iter (± 778186) 23594962 ns/iter (± 54120) 1.20

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

@atuchin-m atuchin-m force-pushed the pre-release-0.11.x-fixes branch from f011755 to e045807 Compare October 20, 2025 14:14
@atuchin-m atuchin-m requested a review from antonok-edm October 20, 2025 14:14
/// Decodes permission bits from the last byte of a script string
/// Decodes permission bits from the last char of a script string
/// Returns (permission, script) tuple
pub(crate) fn decode_script_with_permission(encoded_script: &str) -> (PermissionMask, &str) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch. Can we change encoded script + permissions to be &[u8] in all instances? Should make it harder to misuse, especially considering that Rust APIs widely assume a &str is valid Unicode data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately, that's problematic: it hits the flatbuffer format limitations. It doesn't support arrays of arrays, so we have to wrap it in a new table. That will consume extra memory and makes the code less clear.

@atuchin-m atuchin-m merged commit 059f7b6 into master Oct 20, 2025
9 checks passed
@atuchin-m atuchin-m deleted the pre-release-0.11.x-fixes branch October 20, 2025 20:14
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.

4 participants