fix: avoid vector copies in CheckIfSubtreesAreEqual#27854
Open
lhrios wants to merge 2 commits into
Open
Conversation
…all. Changed to const&
Contributor
Author
Contributor
Author
xadupre
approved these changes
Apr 23, 2026
Member
|
@copilot can you merge with main branch |
Contributor
|
I guess copilot couldn't ;) @xadupre |
Member
|
@cbourjau can you update your PR, maybe I cannot trigger copilot on others PR or I can create another PR taking your changes to complete this task. Whichever works for me. |
Contributor
|
@xadupre this is not my PR; I'm just a very interested bystander/profiteer 🙈 |
Contributor
Author
|
@xadupre, I'm happy to update it. Let me know if there is anything else I should change. I think I already gave you permissions: 🤔
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

indicesis built once and then only read during recursive calls toCheckIfSubtreesAreEqual. However it was passed by value, causing a full copy on every recursive call. Changed toconst&.Data from the profiler:
To collect the following data, a model with a single TreeEnsembleClassifier node (5000 trees and 3.3 million nodes) has been used. The loading time dropped from 18 minutes to about 4 seconds.
After
Before