examples/tutorial/parallel-quick-sort/README.md
This example implements a parallel version of quicksort by napa.js, and compares its performance to that of a serial version. It demonstrates
examples/tutorial/parallel-quick-sort.npm install to install napajs.node parallel-quick-sort.js.Note: This example involves TypedArray and SharedArrayBuffer. It requires Node v9.0.0 or newer.
The table below shows results of the serial quicksort and the parallel one.
quickSort: It took ( 1006 ) MS to sort an array with 4194304 elements.
parallelQuickSort: It took ( 388 ) MS to sort an array with 4194304 elements.
Both of them were executed on a 4 millions length Float64Array. The parallel implementation by napa.js brought 60+% performance gain under my test environment below.
| Name | Value |
|---|---|
| Processor | Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz, 2000 Mhz, 6 Core(s), 12 Logical Processor(s) |
| System Type | x64-based PC |
| Physical Memory | 32.0 GB |
| OS version | Microsoft Windows Server 2016 Datacenter |