示例工程 01-mental-model

01-mental-model/05-load-reuse-bench/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
 
h.describe("load 重用", function()
	h.it("编译一次明显快于每次 load", function()
		local result = m.run(function() end)
		h.eq(result.faster, true)
		h.truthy(result.fresh > result.reuse)
	end)
end)
 
h.run()