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
"Large number of open WorkerModule requests, some may not be returning" warning #112
Comments
Hmm, that warning doesn't trigger until there are >1000 open worker requests. Do you have a very large number of text instances? |
I have been setting instances that have no content to .visible = false but I guess that still means the instance exists would you recommend instead of using the .visible prop to remove unused instances entirely? |
Ahh, that could explain it. Any calls to .sync() will still be issued to the worker in the background even if visible:false, and they'll pile up. I do think I'd personally opt to create/dispose the labels on demand, or at least prevent .sync() calls for hidden ones. Those worker requests all use the same worker so if it's busy processing hidden labels then that could delay the processing of your visible ones. |
I'm making some assumptions, though, not having seen your exact LabelView code. It's still possible that there's a bug on my end, so LMK what you find. |
Just tried to only call .sync() when .visible === true but still getting the warnings if instead I only create instances for for visible objects and destroy unused ones then the warnings go away |
Hmm, Is your LabelView wrapper code available anywhere I can take a peek? |
It's part of a closed source project but here is the relevant class, which might be enough
|
Hmm, my hunch would be syncIfVisible() is getting called before .visible is set to false, but it's hard to say for sure without knowing how your view system works. Something else I'm noticing is that you're issuing syncIfVisible calls after every individual property change (content, textAlign, horizontalAlign, etc.) which will be issuing more calls to the worker than necessary. If your view system has a lifecycle where you can issue a single sync call after all individual properties are set, that would be much better. |
From what you've described, I think this warning is behaving as expected; it correctly highlighted a performance issue. I'm closing this issue; feel free to reopen it if you believe differently. Thanks! |
Just getting back to this So it turns out I easily have over 1000 text instances in my scene. But there just not all visible at the same time Many of them just appear on mouse-over of certain objects So I am wondering what the best way forward is here:
|
Personally I'd go for the first option. I could be wrong but I don't think there's any benefit to having all those hidden label objects present in the scene graph. |
Got it I need to be able to show them quickly on mouse hover of objects Would you recommend just destroying them after use and creating new ones on hover or just remove them from the threeJs scene instead? |
Honestly I don't think there's going to be a noticeable difference either way. I'd start with whatever's simplest to manage and optimize only if you notice an issue. Personally I've done the create/destroy approach a lot, and it's always plenty snappy for me. |
Hi there, I am seeing a large amount of warnings coming from troika-worker.utils.esm.js with this message.
Everything seems to be working fine though
any idea?
The text was updated successfully, but these errors were encountered: