The following numbers have been measured with the bench.py script provided in the source distribution. Since the numbers don’t vary much between python minor releases (e.g. 2.6 vs 2.7), only the benchmarks for 2.7 and 3.2 are given below. The docs/BENCHMARKS file in the source distribution contains the full list.
Here’s the list of benchmarked implementations:
Note that jsmin 2.0.2 and slimit produce output different from the original jsmin.c. Also the simple port was modified to use cStringIO if available (it’s faster then) or io (for python 3).
And here’s a list of the benchmarked javascript files:
Inside the parentheses are size information in KiB (actually: number of characters/1024). The sign behind the size value denotes the size difference in relation to the simple port (i.e. jsmin itself). Note that “knockout” contains ‘+ ++‘ sequences, so rjsmin produces results bigger than the simple port (which collapses those).
| Name | apiviewer (953.2) | jquery (242.4) |
|---|---|---|
| Simple Port | 3001.55 ms (951.5 *) | 653.28 ms (135.9 *) |
| jsmin 2.0.2 | 531.25 ms (951.4 <) | 122.38 ms (136.5 >) |
| slimit 0.6 | n/a | n/a |
| slimit 0.6 (mangle) | n/a | n/a |
| rJSmin | 83.96 ms (951.5 =) | 120.19 ms (135.9 =) |
| _rJSmin | 3.36 ms (951.5 =) | 1.34 ms (135.9 =) |
| Name | knockout (38.9) | markermanager (28.6) |
|---|---|---|
| Simple Port | 118.51 ms (38.6 *) | 59.56 ms (11.6 *) |
| jsmin 2.0.2 | 22.09 ms (38.6 >) | 12.45 ms (11.6 >) |
| slimit 0.6 | n/a | n/a |
| slimit 0.6 (mangle) | n/a | n/a |
| rJSmin | 4.40 ms (38.6 >) | 7.19 ms (11.6 =) |
| _rJSmin | 0.14 ms (38.6 >) | 0.10 ms (11.6 =) |
| Name | apiviewer (953.2) | jquery (242.4) |
|---|---|---|
| Simple Port | 3525.31 ms (951.5 *) | 742.71 ms (135.9 *) |
| jsmin 2.0.2 | 724.06 ms (951.4 <) | 170.65 ms (136.5 >) |
| slimit 0.6 | 16649.53 ms (944.3 <) | 2270.43 ms (134.0 <) |
| slimit 0.6 (mangle) | 20662.24 ms (922.8 <) | 2666.06 ms ( 95.0 <) |
| rJSmin | 68.52 ms (951.5 =) | 110.20 ms (135.9 =) |
| _rJSmin | 3.19 ms (951.5 =) | 1.28 ms (135.9 =) |
| Name | knockout (38.9) | markermanager (28.6) |
|---|---|---|
| Simple Port | 142.17 ms (38.6 *) | 67.97 ms (11.6 *) |
| jsmin 2.0.2 | 31.65 ms (38.6 >) | 16.73 ms (11.6 >) |
| slimit 0.6 | 864.39 ms (39.0 >) | 172.83 ms (11.5 <) |
| slimit 0.6 (mangle) | 1056.11 ms (38.9 >) | 213.42 ms ( 8.6 <) |
| rJSmin | 3.81 ms (38.6 >) | 6.64 ms (11.6 =) |
| _rJSmin | 0.14 ms (38.6 >) | 0.10 ms (11.6 =) |