Skip to content

Add proper disposal of texture and geometry resources - #270

Merged
snide merged 4 commits into
mainfrom
perfImprovements
Apr 11, 2025
Merged

snide merged 4 commits into
mainfrom
perfImprovements

Conversation

@dgreenheck

@dgreenheck dgreenheck commented Apr 10, 2025 •

Copy link
Copy Markdown
Collaborator

What Changed

  • Dispose of old textures
  • Dispose of geometry for ParticleEffect
  • Properly dispose of effects composer and passes
  • Switched all texture loading to use the Threlte useLoader
  • Disable perf in docs app due to Threlte / Three.js mismatch

How was this tested?

Used the Spector.js Chrome browser extension. Observed the Buffer memory was increasing over time. After proper disposal of particle geometry, allocated buffer memory now remains constant when changing scenes and weather parameters.

Before

image

After

image

@github-actions

github-actions Bot commented Apr 10, 2025 •

Copy link
Copy Markdown
Contributor

Fly Preview Deployments - Completed ✅

@snide snide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dgreenheck. Got around to testing this. When I run it, the weather is pretty broken in both the docs and the app. Just load up the preview docs and switch from Rain to Snow and you'll see a pretty obvious break. Seems to be the same in the app when I switch the weather type.

@dgreenheck

Copy link
Copy Markdown
Collaborator Author

@snide Should be ready for another test. The Fly deployments are out of date so make sure you pull local.

@snide snide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did my usual battery of testing. I don't see anything broken from a usage perspective. Typically I hear my fans spin, so I think you might have fixed it.

Gonna merge this and see how it goes. TY!

@snide
snide merged commit c0db3d0 into main Apr 11, 2025
@snide
snide deleted the perfImprovements branch April 11, 2025 16:46
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