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

Is spawning a new worker for every image a good idea? #10

Open
kurtextrem opened this issue Feb 9, 2018 · 9 comments
Open

Is spawning a new worker for every image a good idea? #10

kurtextrem opened this issue Feb 9, 2018 · 9 comments
Labels
question Further information is requested

Comments

@kurtextrem
Copy link
Contributor

See title. I don't really have experience with those, but shouldn't be one worker sufficient? I imagine loading 50+ images via 50 workers is slower than loading 50 images with 1 worker

@nitish24p
Copy link
Owner

Yes this had come up into my head. Browsers offer support for using shared workers instances, so can try that or can terminate the worker once the inage has been downloaded.

@nitish24p nitish24p added the question Further information is requested label Feb 10, 2018
@nitish24p
Copy link
Owner

@manjula91 thoughts..

@kurtextrem
Copy link
Contributor Author

kurtextrem commented Feb 10, 2018

I'll ask Benedikt Meurer on Twitter, he's a v8 performance engineer. https://twitter.com/kurtextrem/status/962234931400335367

I'd guess when we spawn more than OS CPU cores - 1 (as one core is used already by the main thread), we probably have no benefits or a negative impact. But let's find out, I'm curious as well :)

@manjula-dube
Copy link
Collaborator

shared workers can be given a shot here

@manjula-dube
Copy link
Collaborator

@kurtextrem Lets find out how impact full it will in this case?

@kurtextrem
Copy link
Contributor Author

What would be the difference in our case between those two? The only difference I can see is "[Shared Workers can be] accessed from several browsing contexts, such as several windows, iframes or even workers"
I think we should continue using Web Workers, especially as Apple / Safari dropped Shared Workers support, and instead of spawning them in each component, we should spawn them outside or in a factory that decides whether enough have been spawned or not.

@manjula-dube
Copy link
Collaborator

Fair enough i think that sounds great. Would you want to take this up @kurtextrem ?

@kurtextrem
Copy link
Contributor Author

@manjula91 I'd like to wait for Benedikt's opinion first, but I'd love to do this for sure afterwards! :)

@manjula-dube
Copy link
Collaborator

cool 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants