-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Compile out editor-only logic within _validate_property
in export template
#105907
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
Compile out editor-only logic within _validate_property
in export template
#105907
Conversation
Thanks, this makes sense to me in principle. I'm assuming the benchmarks in the description are with this PR? Can you also give benchmarks without this PR to compare against? |
This could also help with binary size significantly. |
Recompiled and tested. Indeed, it is still faster in the game than in the editor without this PR, but this PR still has significant improvement. without this PR: with this PR: |
e3ca5ea
to
ebf5dd6
Compare
Interesting, is the |
ebf5dd6
to
0fc9fb5
Compare
After this PR, the size of linux release template is reduced by 31KB. Removing the Not sure if we should remove the |
0fc9fb5
to
b5c48f5
Compare
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.
I checked all changes and they are correct.
Though I still think that methods completely wrapped in is_editor_hint()
should just use early return. Partially disabled methods are fine, early return would be error-prone in their case.
d95d632
to
e28be82
Compare
2443622
to
0f09862
Compare
0f09862
to
2c4e790
Compare
I have changed to use return for completely wrapped methods, but I will check it again later. |
2c4e790
to
73eeea1
Compare
I'm surprised that we use the |
|
Now this PR should be rebased. |
73eeea1
to
352b135
Compare
352b135
to
2fbd799
Compare
57f81be
to
6de8252
Compare
6de8252
to
8ba4656
Compare
Rebased and checked all |
Thanks! |
Addresses #103357.
Wraps editor-only logic in
validate_property
withEngine::get_singleton()->is_editor_hint()
orto make it only run in the editor (mainly
PROPERTY_USAGE_NO_EDITOR
PROPERTY_USAGE_READ_ONLY
and property hint ,exceptPROPERTY_USAGE_NONE
,PROPERTY_USAGE_STORAGE
).This speeds up
Object.get_property_list
Resource.duplicate
andNode.duplicate
for certain classes that do many string comparisons in validate property, and should also speed up scene loading.Benchmark:
Edit:
In editor: 200 105 452 360
In game:
before: 124 107 241 217
after: 57 34 186 132