diff --git a/ExampleCodes/SpeedTest/fib.py b/ExampleCodes/SpeedTest/fib.py index 88d9d7a..3f0ae16 100644 --- a/ExampleCodes/SpeedTest/fib.py +++ b/ExampleCodes/SpeedTest/fib.py @@ -1,11 +1,11 @@ from time import time as tt def fib(x:int) -> int: - if x <= 1: return x; + if x <= 1: return x return fib(x-1) + fib(x-2) if __name__ == '__main__': t0 = tt() - result = fib(30) + result = fib(35) t1 = tt() print('cost: ',t1-t0, 'result:', result) diff --git a/src/VM/VM.cpp b/src/VM/VM.cpp index db33585..7a90205 100644 --- a/src/VM/VM.cpp +++ b/src/VM/VM.cpp @@ -209,8 +209,9 @@ namespace Fig "none", *currentFrame->proto->locations[ipIdx])); } - else + else [[likely]] { + Object *obj = callee.AsObject(); if (!obj->isFunction()) { diff --git a/xmake.lua b/xmake.lua index 7928b5b..95b29d5 100644 --- a/xmake.lua +++ b/xmake.lua @@ -15,6 +15,10 @@ elseif is_plat("windows") then add_ldflags("-Wl,--stack,268435456") end +if is_mode("release") then + set_optimize("fastest") +end + set_languages("c++23") add_includedirs("src")