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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster entity cloning #16717
Faster entity cloning #16717
Changes from 19 commits
0b0ab27
6316f3c
d4ac17a
c710dff
581d2d0
c65f20d
1e34bfa
676b7f2
fd73075
34f4d30
56e6ab2
b4f53d5
8699057
4cf7e6e
8b6c9a1
3aefdaf
81558c0
fbaefd8
a9739a1
588eba7
5c7c42e
41d5619
7b41bf9
53ec75d
cff4ba6
9601364
56ff78d
fe31086
d484a9f
52b1f26
e86b963
2d11e57
7b0f45d
3cb6891
0de432d
ca17d74
3c70318
05a307a
b15c917
6f03851
fbaa0cb
1ae0d0d
a2a78d6
35a1902
b02678d
4abf6b9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much slower is this? I'm sure it is slower due to the extra
clone_value
, but it basically works the same asclone_fast
after that: it attemptsReflectFromReflect
, thenReflectDefault
, thenReflectFromWorld
, and then panics otherwise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As slow as the results in the
main, avg
column of the benchmark table.Yeah, it seems
clone_slow
is pretty much reserved forReflectFromWorld
now and can panic. Maybe I should try to do it manually instead of usingReflectComponent
then.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like some of this is duplicated from
clone_fast
. Maybe we could merge the two to avoid double lookups and unnecessary retries (i.e. ifcomponent_info.type_id()?
fails inclone_fast
, there's no need to try again inclone_slow
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This can panic. If that's undesirable, it may be worth creating a non-panicking version.