mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-17 18:11:28 +00:00
lua 프로젝트 레이아웃 변경
This commit is contained in:
20
lua/bench_lua_vs_rust/example.lua
Normal file
20
lua/bench_lua_vs_rust/example.lua
Normal file
@ -0,0 +1,20 @@
|
||||
require("lib")
|
||||
|
||||
local iter;
|
||||
if arg[1] == nil or arg[1] == '' then
|
||||
iter = 5000;
|
||||
else
|
||||
iter = tonumber(arg[1]);
|
||||
end
|
||||
|
||||
print(string.format("%s - %u", "lua iter", iter));
|
||||
|
||||
local file = io.open("../benchmark/example.json", "r");
|
||||
io.input(file)
|
||||
local data = io.read("*a");
|
||||
io.close(file);
|
||||
local template = compile("$..book[?(@.price<30 && @.category==\"fiction\")]");
|
||||
for i = 0, iter do
|
||||
local r = template(data);
|
||||
-- print(r);
|
||||
end
|
Reference in New Issue
Block a user