edubart / nelua-lang

Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.
https://nelua.io
MIT License
2.06k stars 67 forks source link

about -fno-crossjumping -fno-gcse #100

Closed esrrhs closed 3 years ago

esrrhs commented 3 years ago

I test the two option, and the benchmark result is nearly same. here is the code

function fibonacci(n)
    if n<3 then
        return 1
    else
        return fibonacci(n-1) + fibonacci(n-2)
    end
end

print(fibonacci(39))
edubart commented 3 years ago

This example is too simple for benchmark what -fno-crossjumping -fno-gcse can do, you can read more about this flag and Lua interpreter optimization in general in this thread: http://lua-users.org/lists/lua-l/2020-08/msg00153.html

At some point Dibyendu Majumdar told about using -fno-crossjumping -fno-gcse in the Lua VM to speedup and I got 4% speedup of the Nelua compiler, which is much complex than that. http://lua-users.org/lists/lua-l/2020-08/msg00165.html