diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2021-12-19 08:41:08 -0500 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-12-19 17:03:07 +0100 |
commit | 1b664dd87084ec8614371ea951791b10533b83c2 (patch) | |
tree | 40a0ada6d334949012fc90d534ba557f586bb12f | |
parent | 49f7d2494ce178162a96da57315ad41f6c2796c6 (diff) | |
download | minetest-1b664dd87084ec8614371ea951791b10533b83c2.tar.gz minetest-1b664dd87084ec8614371ea951791b10533b83c2.tar.bz2 minetest-1b664dd87084ec8614371ea951791b10533b83c2.zip |
Use defined evaluation order in profiler
See https://github.com/LuaJIT/LuaJIT/issues/238
-rw-r--r-- | builtin/profiler/instrumentation.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/profiler/instrumentation.lua b/builtin/profiler/instrumentation.lua index 6b951a2c2..f80314b32 100644 --- a/builtin/profiler/instrumentation.lua +++ b/builtin/profiler/instrumentation.lua @@ -102,8 +102,9 @@ local function instrument(def) -- also called https://en.wikipedia.org/wiki/Continuation_passing_style -- Compared to table creation and unpacking it won't lose `nil` returns -- and is expected to be faster - -- `measure` will be executed after time() and func(...) - return measure(modname, instrument_name, time(), func(...)) + -- `measure` will be executed after func(...) + local start = time() + return measure(modname, instrument_name, start, func(...)) end end |