3 ms·
I'm still amazed that there is code in-lining across lineages. I saw that on the last post and I still can't imagine all of the edge cases that are being handle
by gravypod 8y ago
I'm still amazed that there is code in-lining across lineages. I saw that on the last post and I still can't imagine all of the edge cases that are being handled by that. Are there many other languages that do that other than LuaJIT?
- BeeOnRope 8y agoThe native code isn't being inlined into the compiled LUA code - it is still making a function call. It's just that the way it happens to do the call is faster than C calling a function in a shared object.
- cryptonector 8y agoRepeat after me: TFA is not about C nor Lua, it's about static vs. dynamic linking only.
- BeeOnRope 8y agoDid you actually read it? It compares three cases: dynamic linking, calls through a function pointer and calls where the address to call is compiled directly into an immediate call instruction using a small JIT intended to emulate the LuaJIT case. The benchmark didn't even include a static linking case! In general, however, I expect the static linking case to perform like the JIT case since both will almost always use a call with 32-bit relative immediate jump. I was a bit confused about why the article author chose to write a JIT rather than just use static linking, since I think they achieve the same thing here.
- nicoburns 8y agoRust is planning to enable inlining C functions in the near future. I believe this should work in both directions, and works because they are both compiled using LLVM.
- steveklabnik 8y agohttps://github.com/rust-lang/rust/pull/50000 https://github.com/rust-lang/rust/pull/50000 is the first bit, https://github.com/rust-lang/rust/issues/49879 https://github.com/rust-lang/rust/issues/49879 is the tracking issue.