Skip to content
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

Performance issues appear when used in create-react-app #136

Open
rohan-deshpande opened this issue Dec 6, 2020 · 1 comment
Open

Performance issues appear when used in create-react-app #136

rohan-deshpande opened this issue Dec 6, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rohan-deshpande
Copy link
Collaborator

Currently this is a bit of a mystery to me but when including three-nebula in a create-react-app app - performance seems to be significantly impacted. The issue can be rectified by including the lib in a script tag rather than as a dependency.

If included as a dependency via npm install three-nebula, GPU rendered systems which clock in at a rock solid 60FPS normally are maxing out at 40FPS.

If the lib is included as a script tag in public/index.html and Nebula is accessed via the window everything is fine.

Perhaps this is related to #94. You can't modify the babel config in CRA apps without ejecting so that solution is not going to work.

Ideally what would have to happen would be to investigate what function in particular was causing the issue and fix it.

image (5)

@manthrax has done some investigating and noticed that the performance profiles for an identical system look totally different in the different environments.

Note that this doesn't seem to be happening in the GPURenderer example for an app built with next so it more than likely is something odd in the create-react-app config.

@rohan-deshpande rohan-deshpande added bug Something isn't working help wanted Extra attention is needed labels Dec 6, 2020
@rohan-deshpande
Copy link
Collaborator Author

rohan-deshpande commented Dec 7, 2020

One interesting thing re: the next app is that the library isn't pulled in via a regular import. For code splitting purposes, the following approach is used

const { default: ParticleSystem, GPURenderer } = await import(
  'three-nebula'
);

I'm unsure right now if this has any implications or not...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant