-
Notifications
You must be signed in to change notification settings - Fork 438
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
perf: reduce type resolution to find extension methods for serialization in NetworkBehaviourILPP #3224
base: develop
Are you sure you want to change the base?
perf: reduce type resolution to find extension methods for serialization in NetworkBehaviourILPP #3224
Conversation
@ruccho |
Running this through our CI tests exposes a bunch of issues:
I liked the direction you were going with this, but it seems that some of your proposed optimizations cause ILPP to miss processing specific types/classes. |
@NoelStephensUnity static void ReadValueSafe(this FastBufferReader reader, out T value)
static void ReadValueSafe(this ref FastBufferReader reader, out T value) I think I was able to fix it. Could you please try again? |
Running with the updates. |
This PR will improve the performance of
NetworkBehaviourILPP
.Currently,
NetworkBehaviourILPP
performsTypeReference
resolutions for attribute and parameter types to find custom serialization methods in all referenced assemblies. It causes a read to the assembly containing the type if it has not been loaded yet.We can skip the process earlier by first filtering methods with only the information we can get without
TypeDefinition
.Measurement
With
minimalproject
, I used the following code for measurement.Before
After
Changelog
Testing and Documentation