diff options
| author | Mark Pulford <mark@kyne.com.au> | 2012-01-03 21:25:31 +1030 |
|---|---|---|
| committer | Mark Pulford <mark@kyne.com.au> | 2012-01-03 21:25:31 +1030 |
| commit | 041a32e52f694b68a881a72b7cb5f62aca449400 (patch) | |
| tree | fe4022fbd560806abf28062b4185c9dd7b83fe76 /tests/bench.lua | |
| parent | 3577e3548471da045a5198d2a9a64eba5383d8da (diff) | |
| download | lua-cjson-041a32e52f694b68a881a72b7cb5f62aca449400.tar.gz lua-cjson-041a32e52f694b68a881a72b7cb5f62aca449400.tar.bz2 lua-cjson-041a32e52f694b68a881a72b7cb5f62aca449400.zip | |
Convert common.lua into cjson-misc module
Diffstat (limited to 'tests/bench.lua')
| -rwxr-xr-x | tests/bench.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/bench.lua b/tests/bench.lua index c81213d..2b5177b 100755 --- a/tests/bench.lua +++ b/tests/bench.lua | |||
| @@ -6,10 +6,9 @@ | |||
| 6 | -- | 6 | -- |
| 7 | -- Mark Pulford <mark@kyne.com.au> | 7 | -- Mark Pulford <mark@kyne.com.au> |
| 8 | 8 | ||
| 9 | require "common" | ||
| 10 | require "socket" | 9 | require "socket" |
| 11 | |||
| 12 | local json = require "cjson" | 10 | local json = require "cjson" |
| 11 | local misc = require "cjson-misc" | ||
| 13 | 12 | ||
| 14 | function benchmark(tests, seconds, rep) | 13 | function benchmark(tests, seconds, rep) |
| 15 | local function bench(func, iter) | 14 | local function bench(func, iter) |
| @@ -54,7 +53,7 @@ function benchmark(tests, seconds, rep) | |||
| 54 | end | 53 | end |
| 55 | 54 | ||
| 56 | function bench_file(filename) | 55 | function bench_file(filename) |
| 57 | local data_json = file_load(filename) | 56 | local data_json = misc.file_load(filename) |
| 58 | local data_obj = json.decode(data_json) | 57 | local data_obj = json.decode(data_json) |
| 59 | 58 | ||
| 60 | local function test_encode () | 59 | local function test_encode () |
