aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2012-01-21 23:02:08 +1030
committerMark Pulford <mark@kyne.com.au>2012-03-04 18:54:35 +1030
commite39de35aca9998711a5c16d70ee4702e4e446123 (patch)
tree93ffc77d787439ab18827906d7a60cb9c1d43903
parentf1eda76cf5b8923d7e3cec43e89f2aa60c44c008 (diff)
downloadlua-cjson-e39de35aca9998711a5c16d70ee4702e4e446123.tar.gz
lua-cjson-e39de35aca9998711a5c16d70ee4702e4e446123.tar.bz2
lua-cjson-e39de35aca9998711a5c16d70ee4702e4e446123.zip
Update performance documentation for clarity
-rw-r--r--performance.txt68
1 files changed, 44 insertions, 24 deletions
diff --git a/performance.txt b/performance.txt
index dd0872e..2fd5c7d 100644
--- a/performance.txt
+++ b/performance.txt
@@ -1,41 +1,58 @@
1JSON performance under Lua 1JSON module performance comparison under Lua
2========================== 2============================================
3Mark Pulford <mark@kyne.com.au>
4:revdate: Janurary 21, 2012
5
6This performance comparison aims to provide a guide of relative
7performance between several fast and popular JSON modules.
8
9The examples used in this comparison were mostly sourced from the
10http://json.org[JSON website] and
11http://tools.ietf.org/html/rfc4627[RFC 4627].
12
13Performance will vary widely between platforms and data sets. These
14results should only be used as an approximation.
15
3 16
4Modules 17Modules
5------- 18-------
6 19
7The following fast JSON libraries for Lua were tested: 20The following JSON modules for Lua were tested:
8 21
9[horizontal]
10http://chiselapp.com/user/dhkolf/repository/dkjson/[DKJSON 2.1]:: 22http://chiselapp.com/user/dhkolf/repository/dkjson/[DKJSON 2.1]::
11 - A Lua implementation with no dependencies 23 - Lua implementation with no dependencies on other libraries
12 - Also supports LPeg to improve decode performance 24 - Supports LPeg to improve decode performance
13 - Tested with/without LPeg 10.2
14https://github.com/brimworks/lua-yajl[Lua YAJL 2.0]::
15 - A C wrapper for the YAJL library
16 - Built with YAJL 2.0.4
17http://www.kyne.com.au/~mark/software/lua-cjson.php[Lua CSJON 2.0.0]::
18 - A C implementation with no dependencies on other libraries
19 - Tested with/without internal floating point conversion routines
20 25
21The following Lua implementations were used for this comparison: 26https://github.com/brimworks/lua-yajl[Lua YAJL 2.0]::
27 - C wrapper for the YAJL library
22 28
23- http://www.lua.org[Lua 5.1.4] 29http://www.kyne.com.au/~mark/software/lua-cjson.php[Lua CSJON 2.0.0]::
24- http://www.luajit.org[LuaJIT 2.0.0-beta9] 30 - C implementation with no dependencies on other libraries
25 31
26 32
27Summary 33Summary
28------- 34-------
29 35
30All libraries were built and used with their default settings. 36All modules were built and tested as follows:
31 37
32These results represent the number of JSON operations per second 38DKJSON:: Tested with/without LPeg 10.2.
33sustained by each module. All the results have been normalised against 39Lua YAJL:: Tested with YAJL 2.0.4.
34the pure Lua DKSJON implementation. 40Lua CJSON:: Tested with Libc and internal floating point conversion
41 routines.
42
43The following Lua implementations were used for this comparison:
44
45- http://www.lua.org[Lua 5.1.4] (_Lua_)
46- http://www.luajit.org[LuaJIT 2.0.0-beta9] (_JIT_)
47
48These results show the number of JSON operations per second sustained by
49each module. All results have been normalised against the pure Lua
50DKJSON implementation.
35 51
36.Decoding performance 52.Decoding performance
37............................................................................ 53............................................................................
38 | DKJSON +LPeg | Lua YAJL | Lua CJSON +fpconv 54 | DKJSON | Lua YAJL | Lua CJSON
55 | No LPeg With LPeg | | Libc Internal
39 | Lua JIT Lua JIT | Lua JIT | Lua JIT Lua JIT 56 | Lua JIT Lua JIT | Lua JIT | Lua JIT Lua JIT
40example1 | 1x 2x 2.6x 3.4x | 7.1x 10x | 14x 20x 14x 20x 57example1 | 1x 2x 2.6x 3.4x | 7.1x 10x | 14x 20x 14x 20x
41example2 | 1x 2.2x 2.9x 4.4x | 6.7x 9.9x | 14x 22x 14x 22x 58example2 | 1x 2.2x 2.9x 4.4x | 6.7x 9.9x | 14x 22x 14x 22x
@@ -46,12 +63,14 @@ numbers | 1x 2.2x 2.3x 4x | 4.6x 5.5x | 8.9x 10x 13x 17x
46rfc-example1 | 1x 2.1x 2.8x 4.3x | 6.1x 8.1x | 13x 19x 14x 21x 63rfc-example1 | 1x 2.1x 2.8x 4.3x | 6.1x 8.1x | 13x 19x 14x 21x
47rfc-example2 | 1x 2.1x 3.1x 4.2x | 7.1x 9.2x | 15x 21x 17x 24x 64rfc-example2 | 1x 2.1x 3.1x 4.2x | 7.1x 9.2x | 15x 21x 17x 24x
48types | 1x 2.2x 2.6x 4.3x | 5.3x 7.4x | 12x 20x 13x 21x 65types | 1x 2.2x 2.6x 4.3x | 5.3x 7.4x | 12x 20x 13x 21x
66-------------|-------------------------|------------|-----------------------
49= Average => | 1x 2.1x 2.7x 4.1x | 6.5x 9x | 13x 20x 14x 21x 67= Average => | 1x 2.1x 2.7x 4.1x | 6.5x 9x | 13x 20x 14x 21x
50............................................................................ 68............................................................................
51 69
52.Encoding performance 70.Encoding performance
53............................................................................. 71.............................................................................
54 | DKJSON +LPeg | Lua YAJL | Lua CJSON +fpconv 72 | DKJSON | Lua YAJL | Lua CJSON
73 | No LPeg With LPeg | | Libc Internal
55 | Lua JIT Lua JIT | Lua JIT | Lua JIT Lua JIT 74 | Lua JIT Lua JIT | Lua JIT | Lua JIT Lua JIT
56example1 | 1x 1.8x 0.97x 1.6x | 3.1x 5.2x | 23x 29x 23x 29x 75example1 | 1x 1.8x 0.97x 1.6x | 3.1x 5.2x | 23x 29x 23x 29x
57example2 | 1x 2x 0.97x 1.7x | 2.6x 4.3x | 22x 28x 22x 28x 76example2 | 1x 2x 0.97x 1.7x | 2.6x 4.3x | 22x 28x 22x 28x
@@ -62,8 +81,9 @@ numbers | 1x 2.3x 1x 2.2x | 1.3x 1.9x | 3.8x 4.1x 4.2x 4.6x
62rfc-example1 | 1x 1.9x 0.97x 1.6x | 2.2x 3.2x | 8.5x 9.3x 11x 12x 81rfc-example1 | 1x 1.9x 0.97x 1.6x | 2.2x 3.2x | 8.5x 9.3x 11x 12x
63rfc-example2 | 1x 1.9x 0.98x 1.6x | 2.6x 3.9x | 10x 11x 17x 19x 82rfc-example2 | 1x 1.9x 0.98x 1.6x | 2.6x 3.9x | 10x 11x 17x 19x
64types | 1x 2.2x 0.97x 2x | 1.2x 1.9x | 11x 13x 12x 14x 83types | 1x 2.2x 0.97x 2x | 1.2x 1.9x | 11x 13x 12x 14x
84-------------|-------------------------|------------|-----------------------
65= Average => | 1x 1.9x 0.98x 1.7x | 2.5x 3.9x | 14x 17x 16x 19x 85= Average => | 1x 1.9x 0.98x 1.7x | 2.5x 3.9x | 14x 17x 16x 19x
66............................................................................. 86.............................................................................
67 87
68Performance can vary widely between platforms and data sets. These 88
69results should only be used as a rough guide. 89// vi:ft=asciidoc tw=72: