Skip to content

Conversation

@smitdylan2001
Copy link

Performance improvements. Some minor, some major

  • Combine Position & Rotation calls where possible (probably the biggest change)
  • Use StringComparison where possible
  • Use String.IsNullOrEmpty where possible
  • Combined if(-else) into return or setting the value to reduce branching

I did find some more changes that could help, like combining LINQ calls or reordering vector calculations. These affect readability a bit more, so I decided not to change these. If you want me to change this for better performance let me know. It is also possible to use LinqGen, which is a burst optimized LINQ library which is a lot faster. I also did not touch any deprecated warnings, as I don't know if this would break anything. These are changes that do not change functionality

Performance improvements. Some minor, some major
- Combine Position & Rotation calls where possible (probably the biggest change)
- Use StringComparison where possible
- Use String.IsNullOrEmpty where possible
- Combined if(-else) into return or setting the value to reduce branching

I did find some more changes that could help, like combining LINQ calls or reordering vector calculations. These affect readability a bit more, so I decided not to change these. If you want me to change this for better performance let me know. It is also possible to use LinqGen, which is a burst optimized LINQ library which is a lot faster. I also did not touch any deprecated warnings, as I don't know if this would break anything. These are changes that do not change functionality
@smitdylan2001
Copy link
Author

Some other thoughts:

  • Use texture atlas v2 for most of the UI, so it can be rendered more efficiently
  • Burst seems to be disabled in the main branch, including v8a and v9a for Android could help on the CPU side. Check optimize for performance as well.
  • Reuse collision callbacks should be enabled under physics, reducing garbage allocation
  • Auto sync transforms and enable unified hightmaps should be disabled if possible in the physics settings

In Player settings:

  • Put blit type at auto
  • Graphics jobs could be interesting?
  • If there are any mesh colliders, prebake collision meshes saves starup time
  • Optimize Mesh Data might reduce (GPU) memory if no shaders rely on it

And are there specific shaders that require Multi pass? Single Pass instanced is much faster for almost all apps, so I could look into fixing shader issues if needed

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