New version is online here: Javascript Webworkers

1) How many Web Workers?

Web Workers (each Web Worker launches a new a thread).

2) Test size? Generate n pseudorandom numbers using LCG (info)

This test will run the LCG and generate 2 pseudorandom numbers (, one per Web Worker).

3) Run

This may take a while, depending on the size of the test (tests bigger than 226 may be slow).

Results

For better results run the same test more than once.

Benchmarks

Run

This benchmark will run 50 tests (size: 227) with a variable number of Web Workers: 1, 2, 4, 8 and 16 (it may take a while).

Results (using Firefox 3.6.2 and Test 1.3.1)

1) show - Intel Core 2 Duo E6600 (OC 2.6 GHz, dual core) [ ark.intel.com ]

Benchmark Group #4 average: 7451 ms, 8 Workers [55%]
Benchmark Group #3 average: 7902 ms, 4 Workers [58%]
Benchmark Group #2 average: 7308 ms, 2 Workers [54%]
Benchmark Group #1 average: 13620 ms, 1 Worker [Standart Test, 100%]

2) show - Intel Core 2 Duo T7250 (2.0 GHz, dual core) [ ark.intel.com ]

Benchmark Group #4 average: 9011 ms, 8 Workers [54%]
Benchmark Group #3 average: 9512 ms, 4 Workers [57%]
Benchmark Group #2 average: 8786 ms, 2 Workers [53%]
Benchmark Group #1 average: 16704 ms, 1 Worker [Standart Test, 100%]

3) show - Intel Core 2 Duo T7200 (2.0 GHz, dual core) [ ark.intel.com ]

Benchmark Group #4 average: 8887 ms, 8 Workers [53%]
Benchmark Group #3 average: 8859 ms, 4 Workers [53%]
Benchmark Group #2 average: 8745 ms, 2 Workers [52%]
Benchmark Group #1 average: 16801 ms, 1 Worker [Standart Test, 100%]

4) show - Intel Core 2 Duo E8400 (3.00 GHz, dual core) [ ark.intel.com ]

Benchmark Group #4 average: 6240 ms, 8 Workers [47%]
Benchmark Group #3 average: 6678 ms, 4 Workers [50%]
Benchmark Group #2 average: 6796 ms, 2 Workers [51%]
Benchmark Group #1 average: 13387 ms, 1 Worker [Standart Test, 100%]

5) show - Intel Core 2 Quad Q9400 (2.66 GHz, quad core) [ ark.intel.com ]

Benchmark Group #4 average: 4685 ms, 8 Workers [37%]
Benchmark Group #3 average: 6182 ms, 4 Workers [49%]
Benchmark Group #2 average: 6318 ms, 2 Workers [50%]
Benchmark Group #1 average: 12566 ms, 1 Worker [Standart Test, 100%]

6) show - Intel Core i5 750 (2.66 GHz, quad core) [ ark.intel.com ]

Benchmark Group #4 average: 3507 ms, 8 Workers [40%]
Benchmark Group #3 average: 4531 ms, 4 Workers [52%]
Benchmark Group #2 average: 4590 ms, 2 Workers [53%]
Benchmark Group #1 average: 8669 ms, 1 Worker [Standart Test, 100%]

Old Results (using Firefox 3.5.3 and Test 1.3.0)

1) show - Intel Pentium 4 (2.4 GHz, single core) [ ark.intel.com ]

Benchmark Group #4 average: 28784 ms, 8 Workers [102%]
Benchmark Group #3 average: 28927 ms, 4 Workers [102%]
Benchmark Group #2 average: 28491 ms, 2 Workers [101%]
Benchmark Group #1 average: 28312 ms, 1 Worker [Standart Test, 100%]

2) show - Intel Atom N270 (1.6 GHz, single core, hyper-threading) [ ark.intel.com ]

Benchmark Group #4 average: 37811 ms, 8 Workers [70%]
Benchmark Group #3 average: 37698 ms, 4 Workers [70%]
Benchmark Group #2 average: 37625 ms, 2 Workers [70%]
Benchmark Group #1 average: 53863 ms, 1 Worker [Standart Test, 100%]

3) show - AMD Athlon 2650e (1.6 GHz, single core) [ cpu-world.com]

Benchmark Group #4 average: 23858 ms, 8 Workers [100%]
Benchmark Group #3 average: 23945 ms, 4 Workers [100%]
Benchmark Group #2 average: 24037 ms, 2 Workers [101%]
Benchmark Group #1 average: 23832 ms, 1 Worker [Standart Test, 100%]

4) show - Intel Core 2 Duo T7200 (2.0 GHz, dual core) [ ark.intel.com ]

Benchmark Group #4 average: 7095 ms, 8 Workers [51%]
Benchmark Group #3 average: 7073 ms, 4 Workers [51%]
Benchmark Group #2 average: 7047 ms, 2 Workers [51%]
Benchmark Group #1 average: 13821 ms, 1 Worker [Standart Test, 100%]

5) show - AMD Phenom X4 9500 (2.2 GHz, quad core) [ products.amd.com ]

Benchmark Group #4 average: 4489 ms, 8 Workers [28%]
Benchmark Group #3 average: 4075 ms, 4 Workers [25%]
Benchmark Group #2 average: 8114 ms, 2 Workers [50%]
Benchmark Group #1 average: 16069 ms, 1 Worker [Standart Test, 100%]

6) show - Intel Core 2 Quad Q9400 (2.66 GHz, quad core) [ ark.intel.com ]

Benchmark Group #4 average: 2839 ms, 8 Workers [26%]
Benchmark Group #3 average: 2890 ms, 4 Workers [27%]
Benchmark Group #2 average: 5535 ms, 2 Workers [51%]
Benchmark Group #1 average: 10849 ms, 1 Worker [Standart Test, 100%]

Information

How it Works

This example is quite simple: it launches n Web Workers (threads) and each one verifies a portion of the problem set (in this case, each Web Worker generate a LCG stream of pseudorandom numbers).

Example:
Running 3 Web Workers, using 222 = 4 194 304 as set:
. Web Worker #1 will start the stream with seed 1 and generate 1 398 102 numbers
. Web Worker #2 will start the stream with seed 1 398 103 and generate 1 398 102 numbers
. Web Worker #3 will start the stream with seed 2 796 205 and generate 1 3981 00 numbers

Source Code

All JavaScript source code is online here (except UI code).

Changelog

v1.3.1: This version is now compatible with: Firefox 3.5+ (3.6 and 3.7), Google Chrome 4+ (5 dev) and Safari 4.0.4+.