

Show HN: Sorting 50,000-element array in web browser using HTML5 web worker - afshinmeh
http://afshinm.github.io/50k/?new

======
TheLoneWolfling
...with bubble sort.

Might want to mention that in the title.

~~~
Kiro
I don't see how the algorithm is relevant here.

~~~
TheLoneWolfling
Because with a half-decent sorting algorithm you wouldn't need to use
multithreading for this?

On my machine with that particular 50k length array it takes 7ms if I just do
"a.sort();".

~~~
mackwic
Hey ! Bubble sort _can_ be a descent algorithm when you know when and how to
use it !

After all, it is _the fastest_ sorting algorithm when your collection is
already sorted ! Moreover, it has very nice properties which make it suitable
for a lot of concurrent operations.

~~~
TheLoneWolfling
Insertion sort is faster for already-sorted data.

(Note: I am not advocating to use insertion sort!)

------
lawl
Not meaning to offend you, but... what's the point of this submission?

Webworkers have been here for a while now...

~~~
afshinmeh
To show the difference between performing a time/resource consuming action on
web browsers with web workers and without it.

Excuse me if you didn't find it useful.

------
udfalkso
This is neat, thanks. It would be better if the progress bar actually showed
progress. A simple loading spinner gif would be better if that's all the
progress bar really is in this case. I ran this on my phone earlier and wasn't
sure if anything was actually happening because it took too long, and I gave
up.

~~~
afshinmeh
Ow thanks :-) The reason I used progress-bar is to show the busy time of the
browser while performing the action.

