Skip to content

ashok1994/inbrowser-distributed-merge-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comparision of a Normal Merge Sort and Distributed Merge Sort is used.

Normal Merge Sort: It is done in the main thread (the only thread) , basic implementaion of merge sort.

Distributed Merge Sort: It is done in the worker threads, by using at max 4 worker threads at a time. Merge Sorting 1/4 of part array in different workers. Then merging the 4 parts, in two different workers by making it parallel. Thereby speeding it up.

Using SharedArrayBuffer, we can easily send reference to the worker threads without the overhead of copying over. Combining Web Workers and SharedArrayBuffer,We can implement a lot of parallel algorithms, achieve speed which was possible in low level languages. Also read, TypedArrays which makes numerical arrays creation superfast.

** Note **
Check this issue tc39/security#3 Limited browser support for SharedArrayBuffer .

About

Implementation of distributed merge sort in Browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published