Duktape 1.4.0 performance measurement
Measurement host:
- "Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz" laptop
Duktape is compiled with:
- gcc-4.8.4 (Ubuntu 14.04.3) on x64
gcc -O2
- debugger and interrupt executor support enabled
- fastints enabled (not default)
JSON.stringify()
fast path enabled for columns marked "json", disabled otherwise (default)
Note that:
These are microbenchmarks, and don't necessarily represent application performance very well. Microbenchmarks are useful for measuring how well different parts of the engine work.
Only relative numbers matter. Loop counts differ between test cases so the numbers for two tests are not directly comparable. Absolute numbers may also change between test runs if test target is different.
The measurement process is not very accurate: it's based on running the test multiple times and measuring time using the
time
command.Rhino, Node.js, and LuaJIT are JIT-based engines which are typically 10-100x faster than interpreting engines (like Duktape, MuJS, Lua, etc). Some microbenchmark results may be non-representative because a JIT engine may e.g. eliminate repeated assignments, intended to exercise assignment performance, as dead code.
Performance summary
duk 1.4.0 json |
duk 1.4.0 |
duk 1.3.1 json |
duk 1.2.5 |
duk 1.1.3 |
duk 1.0.2 |
mujs |
lua 5.1 |
python | perl | ruby | rhino | node | luajit | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
test-add-fastint.js | 0.09 | 0.08 | 0.10 | 0.15 | 0.17 | 0.18 | 0.40 | n/a | n/a | n/a | n/a | 0.29 | 0.02 | n/a |
test-add-float.js | 0.08 | 0.08 | 0.11 | 0.14 | 0.17 | 0.18 | 0.40 | n/a | n/a | n/a | n/a | 0.28 | 0.02 | n/a |
test-add-nan-fastint.js | 0.08 | 0.08 | 0.12 | 0.16 | 0.17 | 0.18 | 0.40 | n/a | n/a | n/a | n/a | 0.27 | 0.02 | n/a |
test-add-nan.js | 0.08 | 0.07 | 0.11 | 0.15 | 0.17 | 0.18 | 0.41 | n/a | n/a | n/a | n/a | 0.27 | 0.02 | n/a |
test-array-read.js | 2.17 | 2.13 | 2.30 | 2.64 | 2.94 | 2.99 | 226.58 | 0.95 | 1.77 | 3.27 | 1.46 | 0.37 | 0.03 | 0.00 |
test-array-write.js | 2.56 | 2.55 | 2.42 | 3.19 | 16.63 | 15.71 | 240.41 | 1.13 | 2.46 | 3.27 | 4.06 | 1.08 | 0.05 | 0.00 |
test-assign-add.js | 5.26 | 5.29 | 8.79 | 11.08 | 10.61 | 11.44 | 35.44 | 3.23 | 13.87 | 25.10 | 10.17 | 3.65 | 0.02 | 0.00 |
test-assign-addto-nan.js | 1.41 | 1.43 | 2.62 | 3.59 | 2.75 | 2.90 | 7.35 | n/a | n/a | n/a | n/a | 0.34 | 0.23 | n/a |
test-assign-addto.js | 5.28 | 5.25 | 11.37 | 14.95 | 10.71 | 11.52 | 35.29 | 3.22 | 16.36 | 24.11 | 10.23 | 3.61 | 0.83 | 0.93 |
test-assign-const-int.js | 2.57 | 2.54 | 2.87 | 4.72 | 9.77 | 10.39 | 9.69 | 2.13 | 5.54 | 22.36 | 4.08 | 0.33 | 0.03 | 0.00 |
test-assign-const.js | 3.99 | 4.00 | 2.85 | 4.74 | 11.04 | 11.54 | 9.78 | 2.12 | 5.51 | 22.83 | 4.05 | 0.32 | 0.02 | 0.00 |
test-assign-literal.js | 4.32 | 4.36 | 7.08 | 9.28 | 10.88 | 11.64 | 9.99 | 2.61 | 11.99 | n/a | 4.48 | 0.31 | 0.03 | 0.00 |
test-assign-proplhs-reg.js | 3.77 | 3.66 | 3.96 | 4.12 | 4.67 | 3.86 | 2.41 | n/a | n/a | n/a | n/a | 1.72 | n/a | n/a |
test-assign-proprhs.js | 4.26 | 4.18 | 4.66 | 5.61 | 5.48 | 5.57 | 2.48 | n/a | n/a | n/a | n/a | 0.88 | 0.02 | n/a |
test-assign-reg.js | 2.88 | 2.87 | 5.30 | 9.65 | 5.39 | 5.55 | 8.88 | 2.27 | 5.83 | 23.42 | 4.13 | 0.34 | 0.03 | 0.00 |
test-base64-decode-whitespace.js | 1.91 | 1.89 | 11.04 | 10.74 | 10.89 | 10.81 | n/a | n/a | 8.77 | n/a | n/a | n/a | n/a | n/a |
test-base64-decode.js | 1.53 | 1.54 | 5.46 | 5.54 | 5.97 | 5.34 | n/a | n/a | 8.76 | n/a | n/a | n/a | n/a | n/a |
test-base64-encode.js | 1.85 | 1.88 | 17.52 | 17.18 | 17.30 | 17.28 | n/a | n/a | 17.23 | n/a | n/a | n/a | n/a | n/a |
test-bitwise-ops.js | 0.75 | 0.76 | 0.86 | 1.13 | 5.09 | 5.24 | 3.36 | n/a | n/a | n/a | n/a | 7.84 | 0.02 | n/a |
test-break-fast.js | 1.67 | 1.70 | 1.48 | 1.84 | 1.88 | 2.03 | 1.20 | n/a | n/a | n/a | n/a | 0.30 | 0.04 | n/a |
test-break-slow.js | 7.72 | 7.79 | 11.21 | 11.83 | 11.48 | 11.49 | 2.59 | n/a | n/a | n/a | n/a | 0.30 | 0.54 | n/a |
test-buffer-nodejs-read.js | 2.74 | 2.78 | 2.60 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a | 0.03 | n/a |
test-buffer-nodejs-write.js | 3.03 | 3.05 | 3.29 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a | 0.05 | n/a |
test-buffer-object-read.js | 2.89 | 2.72 | 2.65 | 18.66 | 19.11 | 19.82 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-buffer-object-write.js | 3.03 | 3.08 | 3.31 | 22.62 | 23.33 | 20.32 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-buffer-plain-read.js | 2.21 | 2.26 | 2.16 | 2.46 | 2.72 | 2.75 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-buffer-plain-write.js | 1.90 | 1.94 | 1.75 | 2.35 | 5.01 | 3.20 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-call-basic-1.js | 9.15 | 9.01 | 12.00 | 12.23 | 14.31 | 13.99 | 6.56 | 2.18 | 5.25 | 7.77 | 3.39 | 1.39 | 0.03 | 0.00 |
test-call-basic-2.js | 9.11 | 9.02 | 12.01 | 12.28 | 14.50 | 14.02 | 4.81 | n/a | n/a | n/a | n/a | 0.64 | 0.03 | n/a |
test-call-basic-3.js | 14.65 | 14.60 | 20.00 | 19.97 | 21.23 | 21.22 | 12.42 | n/a | n/a | n/a | n/a | 0.61 | 0.12 | n/a |
test-call-basic-4.js | 35.17 | 35.60 | 45.09 | 50.11 | 50.21 | 49.83 | 36.46 | n/a | n/a | n/a | n/a | 1.43 | 0.53 | n/a |
test-call-native.js | 14.14 | 13.59 | 18.82 | 18.70 | 20.75 | 20.50 | 17.13 | n/a | n/a | n/a | n/a | 1.47 | 3.71 | n/a |
test-compile-mandel-nofrac.js | 13.17 | 13.04 | 13.68 | 16.89 | 18.41 | 18.25 | 5.87 | n/a | n/a | n/a | n/a | 7.10 | 0.04 | n/a |
test-compile-mandel.js | 16.22 | 16.32 | 16.60 | 19.80 | 21.59 | 21.46 | 5.85 | n/a | n/a | n/a | n/a | 7.01 | 0.07 | n/a |
test-compile-short.js | 9.95 | 9.98 | 10.13 | 9.99 | 10.97 | 10.62 | 2.11 | n/a | n/a | n/a | n/a | 3.64 | 0.17 | n/a |
test-continue-fast.js | 2.17 | 2.22 | 1.95 | 2.51 | 2.70 | 2.81 | 1.96 | n/a | n/a | n/a | n/a | 0.51 | 0.05 | n/a |
test-continue-slow.js | 8.42 | 8.44 | 11.78 | 12.52 | 12.43 | 12.52 | 3.35 | n/a | n/a | n/a | n/a | 0.54 | 0.57 | n/a |
test-empty-loop.js | 2.29 | 2.38 | 2.37 | 3.12 | 5.73 | 5.90 | 5.83 | 1.00 | 4.57 | 3.41 | 3.32 | 0.66 | 0.07 | 0.16 |
test-fib.js | 7.90 | 7.61 | 8.60 | 9.17 | 9.82 | 9.89 | 3.30 | 1.33 | 2.41 | 6.43 | 1.52 | 1.18 | 0.16 | 0.27 |
test-global-lookup.js | 10.71 | 10.23 | 11.29 | 11.50 | 11.71 | 11.27 | 4.11 | n/a | n/a | n/a | n/a | 1.14 | 0.02 | n/a |
test-hello-world.js | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.22 | 0.02 | 0.00 |
test-hex-decode.js | 3.60 | 3.61 | 5.34 | 5.32 | 9.38 | 9.36 | n/a | n/a | 12.51 | n/a | n/a | n/a | n/a | n/a |
test-hex-encode.js | 2.80 | 2.82 | 6.06 | 6.00 | 6.69 | 6.72 | n/a | n/a | 1.43 | n/a | n/a | n/a | n/a | n/a |
test-jc-serialize-indented.js | 3.64 | 23.03 | 34.18 | 37.45 | 40.70 | 40.49 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-jc-serialize.js | 2.48 | 20.93 | 28.54 | 31.37 | 34.76 | 36.39 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-json-parse-hex.js | 3.36 | 3.38 | 6.61 | 6.64 | 8.33 | 8.33 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-json-parse-integer.js | 3.94 | 4.01 | 4.06 | 4.09 | 4.06 | 4.12 | 20.95 | n/a | 0.07 | n/a | n/a | 2.26 | 0.32 | n/a |
test-json-parse-number.js | 5.19 | 5.21 | 5.10 | 5.04 | 5.25 | 5.27 | 2.46 | n/a | 0.29 | n/a | n/a | 1.56 | 0.19 | n/a |
test-json-parse-string.js | 5.47 | 5.69 | 5.62 | 30.08 | 30.04 | 30.01 | 44.72 | n/a | n/a | n/a | n/a | 22.48 | 6.08 | n/a |
test-json-serialize-fastpath-loop.js | 3.64 | 19.45 | 32.38 | 35.70 | 40.51 | 38.37 | 12.57 | n/a | n/a | n/a | n/a | 111.97 | 32.99 | n/a |
test-json-serialize-hex.js | 1.45 | 1.49 | 2.78 | 24.35 | 23.75 | 22.47 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-json-serialize-indented-deep100.js | 2.39 | 2.30 | 3.62 | 3.82 | 3.89 | 3.87 | 1.43 | n/a | n/a | n/a | n/a | 40.94 | 1.05 | n/a |
test-json-serialize-indented-deep25.js | 3.30 | 27.25 | 44.80 | 47.44 | 50.61 | 48.59 | 10.29 | n/a | n/a | n/a | n/a | 61.10 | 13.91 | n/a |
test-json-serialize-indented-deep500.js | 1.45 | 1.44 | 2.37 | 2.44 | 2.49 | 2.41 | n/a | n/a | n/a | n/a | n/a | 1246.26 | 0.52 | n/a |
test-json-serialize-indented.js | 6.25 | 46.83 | 69.94 | 76.16 | 82.02 | 82.05 | 14.79 | n/a | n/a | n/a | n/a | 25.46 | 23.71 | n/a |
test-json-serialize-jsonrpc-message.js | 1.97 | 2.52 | 3.97 | 7.85 | 8.02 | 7.75 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-json-serialize-nofrac.js | 0.69 | 4.83 | 0.69 | 6.98 | 7.44 | 7.29 | 1.55 | n/a | n/a | n/a | n/a | 4.14 | 0.61 | n/a |
test-json-serialize-slowpath-loop.js | 5.81 | 5.75 | 8.58 | 9.44 | 10.30 | 10.03 | n/a | n/a | n/a | n/a | n/a | 11.92 | 2.97 | n/a |
test-json-serialize.js | 6.24 | 10.39 | 6.30 | 12.47 | 12.90 | 12.70 | 2.17 | n/a | 0.51 | n/a | n/a | 5.40 | 0.70 | n/a |
test-json-string-bench.js | 5.26 | 5.25 | 5.46 | 5.42 | 6.72 | 6.57 | 51.06 | n/a | n/a | n/a | n/a | 1.98 | 0.25 | n/a |
test-json-string-stringify.js | 5.14 | 5.19 | 6.47 | 17.75 | 17.82 | 17.09 | 10.72 | n/a | 0.48 | n/a | n/a | 18.39 | 5.98 | n/a |
test-jx-serialize-indented.js | 3.72 | 22.64 | 34.09 | 36.06 | 39.81 | 39.56 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-jx-serialize.js | 2.51 | 20.96 | 28.32 | 30.44 | 34.09 | 33.28 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-mandel.js | 4.36 | 4.34 | 4.75 | 5.88 | 6.34 | 6.71 | 13.92 | n/a | n/a | n/a | n/a | 1.60 | 0.21 | n/a |
test-prop-read.js | 4.89 | 4.80 | 5.25 | 6.18 | 6.43 | 6.50 | 3.76 | 1.03 | 2.44 | 4.85 | 11.16 | 0.67 | 0.02 | 0.00 |
test-prop-write.js | 4.28 | 4.21 | 4.44 | 4.86 | 5.68 | 4.79 | 3.73 | 1.16 | 2.45 | 4.96 | 14.77 | 1.90 | 0.03 | 0.00 |
test-reg-readwrite-object.js | 3.31 | 3.22 | 7.79 | 10.93 | 7.18 | 7.48 | 7.81 | 1.75 | 4.80 | 29.30 | 4.00 | 0.36 | 0.02 | 0.00 |
test-reg-readwrite-plain.js | 2.07 | 2.06 | 5.07 | 9.42 | 4.90 | 4.94 | 7.75 | 1.76 | 4.79 | 32.32 | 4.03 | 0.38 | 0.01 | 0.00 |
test-regexp-case-insensitive.js | 23.44 | 23.42 | 23.37 | 23.50 | 24.28 | 24.39 | 0.00 | n/a | n/a | n/a | n/a | 0.23 | 0.01 | n/a |
test-regexp-string-parse.js | 9.75 | 9.52 | 10.66 | 12.83 | 12.68 | 12.74 | n/a | n/a | 0.51 | n/a | n/a | n/a | 0.08 | n/a |
test-string-array-concat.js | 6.68 | 6.79 | 6.49 | 7.83 | 24.22 | 23.52 | 261.36 | 2.11 | 2.84 | 7.44 | 7.84 | 1.99 | 0.39 | 0.86 |
test-string-charlen-ascii.js | 1.36 | 1.39 | 5.31 | 5.32 | 5.33 | 5.33 | 4.70 | n/a | n/a | n/a | n/a | 0.35 | 0.02 | n/a |
test-string-charlen-nonascii.js | 2.82 | 2.80 | 3.92 | 3.94 | 3.95 | 3.96 | 7.14 | n/a | n/a | n/a | n/a | 0.34 | 0.02 | n/a |
test-string-compare.js | 3.91 | 3.82 | 3.82 | 4.61 | 6.08 | 6.11 | 731.42 | 2.81 | 4.89 | 16.51 | 5.37 | 4.43 | 0.87 | 0.13 |
test-string-decodeuri.js | 3.59 | 3.59 | 3.58 | 4.15 | 4.08 | 4.16 | 2.07 | n/a | n/a | n/a | n/a | 2.11 | 3.90 | n/a |
test-string-encodeuri.js | 4.09 | 4.07 | 4.28 | 6.23 | 6.31 | 6.24 | 3.63 | n/a | n/a | n/a | n/a | 6.91 | 40.88 | n/a |
test-string-intern-grow-short.js | 20.92 | 20.74 | 7.18 | 7.73 | 13.37 | 12.34 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-grow-short2.js | 7.35 | 7.35 | 7.27 | 7.81 | 13.32 | 12.45 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-grow.js | 39.22 | 39.43 | 4.98 | 4.93 | 5.57 | 5.56 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-grow2.js | 3.38 | 3.23 | 5.09 | 5.17 | 5.79 | 5.76 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-match-short.js | 2.72 | 2.75 | 2.29 | 2.35 | 2.39 | 2.36 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-match.js | 0.36 | 0.36 | 0.96 | 1.00 | 1.03 | 1.03 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-miss-short.js | 5.55 | 5.67 | 5.11 | 5.23 | 5.50 | 5.52 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-intern-miss.js | 1.27 | 1.27 | 2.53 | 2.59 | 2.80 | 2.75 | n/a | n/a | n/a | n/a | n/a | n/a | n/a | n/a |
test-string-plain-concat.js | 1.04 | 1.07 | 4.13 | 4.16 | 4.26 | 4.15 | 1.03 | 0.60 | 0.00 | 0.41 | 0.81 | 0.30 | 0.02 | 0.63 |
test-string-uppercase.js | 2.21 | 2.22 | 2.65 | 3.54 | 3.35 | 3.48 | 4.50 | n/a | 1.28 | n/a | n/a | 1.67 | 0.09 | n/a |
test-try-catch-nothrow.js | 3.05 | 3.04 | 2.57 | 2.76 | 2.39 | 2.45 | 2.22 | n/a | n/a | n/a | n/a | 0.30 | 0.33 | n/a |
test-try-catch-throw.js | 41.50 | 39.62 | 39.86 | 39.99 | 39.29 | 38.20 | 20.53 | n/a | n/a | n/a | n/a | 133.42 | 8.02 | n/a |
test-try-finally-nothrow.js | 3.63 | 3.68 | 2.81 | 3.32 | 3.12 | 3.18 | 2.06 | n/a | n/a | n/a | n/a | 0.32 | 0.54 | n/a |
test-try-finally-throw.js | 51.09 | 49.40 | 46.12 | 45.92 | 45.58 | 45.41 | 22.90 | n/a | n/a | n/a | n/a | 130.83 | 10.05 | n/a |