aboutsummaryrefslogtreecommitdiff
path: root/tests/bench.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Simplify string.format() callsMark Pulford2012-03-041-2/+2
| | | | Simply string.format() calls with OO method notation.
* Improve benchmark stabilityMark Pulford2012-03-041-7/+36
| | | | | | | | | Update benchmark script to average the best half (round up) of the result set. Ensure the initial call rate is calculated from a run of at least 1ms. Remove garbage collection control since any variations due to garbage collection are better handled by averaging multiple results.
* Rename "cjson-misc" module to "cjson.util"Mark Pulford2012-03-041-4/+4
|
* Update bench.lua to support different JSON modulesMark Pulford2012-03-041-12/+31
| | | | | | - Select via JSON_MODULE environment variable (default "cjson") - Custom runtime configuration can be stored in bench-MODNAME.lua - Add run_script() to cjson-misc and update lua2cjson.lua
* Convert common.lua into cjson-misc moduleMark Pulford2012-01-031-3/+2
|
* Add support for Lua 5.2 and cjson.newMark Pulford2011-12-301-1/+1
| | | | | | | | | | | | | | Update all Lua scripts to use new module init style everywhere: local json = require "cjson" Lua CJSON does not register a global table under Lua 5.2. The global table can be disabled under Lua 5.1 with DISABLE_CJSON_GLOBAL. Other changes: - Store CJSON configuration as an upvalue for each function. - Add "cjson.new" function to create another module table with a separate configuration. - Add _NAME and _VERSION variables.
* Use a benchmark duration, not interation countMark Pulford2011-05-291-2/+12
| | | | | Roughly calculate the number of iterations required to run the benchmark for the chosen duration.
* Add trivial types.json exampleMark Pulford2011-05-291-0/+2
|
* Move all benchmark code into bench.luaMark Pulford2011-05-161-0/+34
| | | | | Move benchmark() into bench.lua since it not used elsewhere. Replace posix.gettimeofday() with socket.gettime() to improve portability.
* Implement data driven test frameworkMark Pulford2011-05-081-8/+7
| | | | | | | | - Add run_test(): Test a function and verify its output - Add run_test_group(): Execute a test batch - Add serialise_value(): Serialise a Lua value into the Lua syntax - Add file_save() helper function - Add NaN comparison support to compare_values()
* Add basic JSON tests and benchmarkMark Pulford2011-05-031-0/+39