3 ms·
They'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.
by masklinn 8y ago
They'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)