Hacker GitHub

← All repos

dyu/ffi-overhead

View on GitHub ↗ ★ 699 C

comparing the c ffi (foreign function interface) overhead on various programming languages

28 mentions on Hacker News by 25 people: 4 stories, 24 comments · first 2014-04-08 · latest 2025-11-23

Mentions per year 28 mentions · busiest year 2018 (10)
20082026
  1. …compare to C. gccgo is not listed there but from my own testing it's the same as C/C++. [0]: https://github.com/dyu/ffi-overhead
  2. ▲ 2
    FFI Overhead
    story by steve-chavez · 2025-09-19 · 1 comment
  3. ▲ 5
    Comparing the C FFI overhead in various programming languages (2021)
    story by nequo · 2024-07-04 · 2 comments
  4. The overhead for Go in benchmarks is insane in contrast to other languages - https://github.com/dyu/ffi-overhead Are there reasons why Go does not copy what Julia does?
    comment by JanisErdmanis · 2024-04-27 · in Leaving Rust gamedev after 3 years
  5. …performance/zero-overhead-FFI[2] it really is a neat language. [1] https://luajit.org/ [2] https://github.com/dyu/ffi-overhead
    comment by vvanders · 2023-05-28 · in Lua: The Little Language That Could
  6. …compiled language like C because you can optimize away some of the bindings at the runtime right? https://github.com/dyu/ffi-overhead is a measurement of that, and you see LuaJIT and Julia as faster than C and Fortran here. This shouldn't…
    comment by ChrisRackauckas · 2023-05-02 · in Can Fortran survive another 15 years?
  7. …take some hit for using an FFI. So you're still incentivized to avoid tons of SQLite calls. https://github.com/dyu/ffi-overhead
    comment by eatonphil · 2023-01-02 · in Understanding the N + 1 queries problem
  8. …the results look outdated. The Dart results look bad (25x slower than C), but looking at the code ( https://github.com/dyu/ffi-overhead/tree/master/dart ) it appears to be five years old. Dart has a new FFI as of Dart 2.5 (2019):…
  9. …but you can find a PR claiming it has 123,198ms. That would be a worst one by a wide margin. https://github.com/dyu/ffi-overhead/pull/18
  10. ▲ 124
    Comparing the C FFI overhead on various languages
    story by generichuman · 2022-05-14 · 95 comments
  11. …of calls across the cgo barrier is quite high, which can have API architecture implications -- https://github.com/dyu/ffi-overhead#results-500m-calls .
    comment by nikki93 · 2021-08-24 · in Why Is SQLite Coded in C (2017)
  12. …things. For example, FFI calls into shared libraries is generally faster with fast JIT languages. https://github.com/dyu/ffi-overhead This is one reason why you could see Julia outperforming Fortran in some cases where the FFI speed…
  13. > C interop is simple and elegant C interop in go is super slow: https://github.com/dyu/ffi-overhead
    comment by Rotareti · 2019-11-17 · in The Value in Go’s Simplicity
  14. …Golang's poor FFI performance is the number 1 reason I wouldn't use it for my own projects. [0]: https://github.com/dyu/ffi-overhead
    comment by Rotareti · 2019-08-12 · in Python Is Eating the World
  15. …there are plenty of questions about embedding Julia into C/C++[2][3]. May be similar for Rust. [0] https://github.com/dyu/ffi-overhead [1] https://github.com/robsmith11/fastfloat [2] https://discourse.julialang.org/t/support-with-embedding-…
    comment by celrod · 2019-02-11 · in Why Swift for TensorFlow?
  16. …to produce libraries. One interesting datapoint is that Julia's C FFI is faster than that of C++... https://github.com/dyu/ffi-overhead (For those interested, the order of the first few languages is: lua-jit, julia, c(!), c++, zig, nim, d…
  17. …thing. I mean the nice thing about Love2d is that LuaJIT has the best ffi overhead when calling C. https://github.com/dyu/ffi-overhead
    comment by pasabagi · 2018-11-11 · in Nine years of Go
  18. …an extremely efficient C FFI, so mixing Rust and Julia (for instance) would be painless if needed. https://github.com/dyu/ffi-overhead It's a great time to be a software developer, and things will only get better as languages and tooling…
    comment by Accipitriform · 2018-10-11 · in A Rust FFI adventure in unsafety
  19. …lot of interesting discussion of go ffi: https://github.com/golang/go/issues/16051 these benchmarks https://github.com/dyu/ffi-overhead seem to show that a c call via cgo will be about 14 (!) times slower than a c call from c# in mono,…
  20. Great ffi perf too! From the benchmark over at github.com/dyu/ffi-overhead, julia is on par with luajit.
  21. [Here's a C# example]( https://github.com/dyu/ffi-overhead/pull/10 ).
  22. …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 )
  23. …good thing to keep in mind for anybody looking at the project and making judgement calls off of it. https://github.com/dyu/ffi-overhead/issues I didn't do so because it wasn't my idea. I certainly don't mind though.
  24. ▲ 141
    Comparing the C FFI overhead in various programming languages
    story by based2 · 2018-05-26 · 83 comments
  25. Well, see my issue: https://github.com/dyu/ffi-overhead/issues/2
    comment by Xeoncross · 2018-02-02 · in Writing space invaders with Go
  26. …at a certain level, due to the amount of opengl calls you have to make. Is this still the case? [1] https://github.com/dyu/ffi-overhead/blob/master/README.md
    comment by rileyphone · 2018-02-02 · in Writing space invaders with Go
  27. …example: // plusone is the ffi int x = 0; while (x < 2000000000) x = plusone(x); Here's the source https://github.com/dyu/ffi-overhead With other programming languages: c: 4778 nim: 4746 rust: 5331 java7: 17922 java8: 17992 go: 130105…
    comment by dyu- · 2017-02-17 · in Go 1.8 Release Notes
  28. …significant performance problem elsewhere, so this is something that cannot be simply ignored. [1] https://github.com/dyu/ffi-overhead
    comment by pbsd · 2014-04-08 · in The Heartbleed Bug