forked from Dependencies/lua-json
				
			Added warmup for JIT in benchmark scripts
							parent
							
								
									8cb56f3d73
								
							
						
					
					
						commit
						9720bb9f10
					
				|  | @ -62,6 +62,9 @@ for i, name in ipairs(libs) do | ||||||
|     json.decode = function(...) return _decode(json, ...) end |     json.decode = function(...) return _decode(json, ...) end | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|  |   -- Warmup (for LuaJIT) | ||||||
|  |   bench.run(name, 1, function() json.decode(text) end) | ||||||
|  | 
 | ||||||
|   -- Run and push results |   -- Run and push results | ||||||
|   local res = bench.run(name, 10, function() json.decode(text) end) |   local res = bench.run(name, 10, function() json.decode(text) end) | ||||||
|   table.insert(results, res) |   table.insert(results, res) | ||||||
|  |  | ||||||
|  | @ -50,6 +50,9 @@ for i, name in ipairs(libs) do | ||||||
|     json.decode = function(...) return _decode(json, ...) end |     json.decode = function(...) return _decode(json, ...) end | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|  |   -- Warmup (for LuaJIT) | ||||||
|  |   bench.run(name, 1, function() json.encode(data) end) | ||||||
|  | 
 | ||||||
|   -- Run and push results |   -- Run and push results | ||||||
|   local res = bench.run(name, 10, function() json.encode(data) end) |   local res = bench.run(name, 10, function() json.encode(data) end) | ||||||
|   table.insert(results, res) |   table.insert(results, res) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue