4 ms·
I believe you're misreading the numbers. They're the "elapsed time in millis", so lower is better. The only result better than c itself seems to be luajit, whic
by jorams 8y ago
I believe you're misreading the numbers. They're the "elapsed time in millis", so lower is better. The only result better than c itself seems to be luajit, which is quite impressive. I wonder how it achieves that.
- earenndil 8y agoAhhh oops you're right. Point still stands, though -- I wonder why those languages should have different results?
- masklinn 8y agoThey're both GC'd languages so the FFI may have some additional work/bookkeeping to do around the native calls, which C or Rust does not.
- dom96 8y agoOP poses a good question and I don't think it's a simple case of GC vs. no GC. In Nim's case it might have something to do with not using the C int types (PR already open to fix this: https://github.com/dyu/ffi-overhead/pull/6 https://github.com/dyu/ffi-overhead/pull/6)