News for hackers. Stuff that matters.
Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo by didip on Friday October 28, 2016 @08:00AM (#12814932)
Is this demo supposed to highlight the strength of web worker? It runs 300-400ms slower on web worker.
Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo by Jtsummers on Friday October 28, 2016 @09:36AM (#12815617)
Web workers offer several benefits:

1) UI isn't locked up by long running tasks;

2) Potential performance improvement by running multiple processes at once (parallelization);

3) Potential design improvements by decomposing the problem into a CSP-like design (which may or may not relate back to (2)).

(2) is really not the purpose though, it's just a potential benefit. golang, for instance, doesn't give us inherently better performance by use of goroutines. What it gives us is better design and separation of execution blocks so that they can run concurrently. Better performance is just a perk when things can run in parallel.

Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo by spiderfarmer on Friday October 28, 2016 @08:10AM (#12814984)
Yes. And it succeeds. The browser is responsive during the web worker method and is beachballing without.
Re:Show HN: Sorting 50K Array, HTML5 Web Worker Demo by sumnulu on Friday October 28, 2016 @08:27AM (#12815059)
"As you can see, without Web Worker, your browser maybe able to sort the 50K Array but you can't work with your browser while sorting and also your browser won't render anything until sorting ends, that's why you can't see the animated progress bar in the page."