Skip to content

Only perform recursion depth checks on recursive messages#553

Merged
Karolina-Bogacka merged 2 commits intomainfrom
piotr/fewer-recursion-checks
Sep 28, 2025
Merged

Only perform recursion depth checks on recursive messages#553
Karolina-Bogacka merged 2 commits intomainfrom
piotr/fewer-recursion-checks

Conversation

@Ostrzyciel
Copy link
Member

A truly micro optimization.

We were checking the recursion depth already quite efficiently, but we can do a little bit better with the observation that most messages are, in fact, not recursive. For them it's enough to just increment the depth.

If we remove the check on everything aside from RdfTriple, our security will not be compromised (as proven by tests). During inlining, the compiler should also get rid of this parameter entirely in some code paths.

@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...u/neverblink/protoc/java/runtime/ProtoMessage.java 70.88% <ø> (-0.72%) 17.00 <0.00> (-1.00)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Karolina-Bogacka Karolina-Bogacka left a comment

Choose a reason for hiding this comment

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

The tests seem sufficient and the changes make sense

@Karolina-Bogacka Karolina-Bogacka merged commit 23fe3dc into main Sep 28, 2025
12 checks passed
@Karolina-Bogacka Karolina-Bogacka deleted the piotr/fewer-recursion-checks branch September 28, 2025 20:18
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.

2 participants