Skip to content

Instantly share code, notes, and snippets.

@kilbith
Created November 15, 2021 20:12
Show Gist options
  • Save kilbith/84e0cb019f20e32436f3a90861dbf891 to your computer and use it in GitHub Desktop.
Save kilbith/84e0cb019f20e32436f3a90861dbf891 to your computer and use it in GitHub Desktop.
Results local vs global function call - LuaJIT and Lua 5.1
jp@r2d2:/mnt/c/Users/jeanp/dev$ luajit local_vs_global.lua
GLOBAL 611.59 ms
GLOBAL 801.54 ms
GLOBAL 737.65 ms
GLOBAL 743.14 ms
GLOBAL 662.23 ms
GLOBAL 624.40 ms
GLOBAL 504.09 ms
GLOBAL 838.43 ms
GLOBAL 981.85 ms
GLOBAL 580.71 ms
GLOBAL 487.24 ms
GLOBAL 775.25 ms
GLOBAL 510.98 ms
GLOBAL 1076.91 ms
GLOBAL 732.03 ms
GLOBAL 542.44 ms
GLOBAL 999.99 ms
GLOBAL 511.13 ms
GLOBAL 890.82 ms
GLOBAL 495.78 ms
Average (GLOBAL) 705.41 ms
---------------------------------
LOCAL 693.65 ms
LOCAL 738.41 ms
LOCAL 1017.44 ms
LOCAL 639.57 ms
LOCAL 528.77 ms
LOCAL 1020.15 ms
LOCAL 528.18 ms
LOCAL 979.18 ms
LOCAL 520.27 ms
LOCAL 673.73 ms
LOCAL 543.67 ms
LOCAL 959.28 ms
LOCAL 682.43 ms
LOCAL 771.00 ms
LOCAL 507.55 ms
LOCAL 743.74 ms
LOCAL 509.53 ms
LOCAL 740.82 ms
LOCAL 648.10 ms
LOCAL 610.44 ms
Average (LOCAL) 702.80 ms
---------------------------------
jp@r2d2:/mnt/c/Users/jeanp/dev$ lua local_vs_global.lua
GLOBAL 915.07 ms
GLOBAL 893.97 ms
GLOBAL 960.37 ms
GLOBAL 1338.90 ms
GLOBAL 1128.05 ms
GLOBAL 1170.72 ms
GLOBAL 1261.45 ms
GLOBAL 865.98 ms
GLOBAL 1316.85 ms
GLOBAL 1187.45 ms
GLOBAL 1216.12 ms
GLOBAL 832.92 ms
GLOBAL 1283.80 ms
GLOBAL 1157.76 ms
GLOBAL 841.48 ms
GLOBAL 1316.27 ms
GLOBAL 1322.92 ms
GLOBAL 895.05 ms
GLOBAL 1331.63 ms
GLOBAL 1289.57 ms
Average (GLOBAL) 1126.32 ms
---------------------------------
LOCAL 1270.76 ms
LOCAL 1282.34 ms
LOCAL 1144.07 ms
LOCAL 835.37 ms
LOCAL 1058.75 ms
LOCAL 1247.25 ms
LOCAL 1270.88 ms
LOCAL 1263.61 ms
LOCAL 888.22 ms
LOCAL 820.78 ms
LOCAL 1253.57 ms
LOCAL 1248.79 ms
LOCAL 1370.59 ms
LOCAL 1482.50 ms
LOCAL 906.62 ms
LOCAL 1393.92 ms
LOCAL 899.88 ms
LOCAL 1349.63 ms
LOCAL 1327.89 ms
LOCAL 1316.10 ms
Average (LOCAL) 1181.58 ms
--------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment