HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dyu
ffi-overhead
C2014–2025
dyu / ffi-overhead

ffi-overhead

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

25Distinct people
28Mentions
0Explicit recommenders
700GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 9:01:12 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year28 dated mentions

Observed mentions: 2014-04-08 01:17:48 UTC to 2025-11-23 13:56:53 UTC.

02468102014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC1019
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC404
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC303
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC211
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC211

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
ffi-overhead comparing the c ffi overhead on various programming languages Requirements: gcc tup zig nim v java7 java8 go rust d (dmd and ldc2) haskell (ghc) ocaml csharp (mono) luajit julia node dart wren elixir My environment: - Intel i7-3630QM laptop (4cores, HT) with 16g ram - Ubuntu 14.04 x64 - gcc/g++ 5.4.1 - tup 0.7.4 - zig 0.2.0 - nim 0.14.3 - v 0.2.2 aebb551 - java 1.7.0_72 and 1.8.0_91 - go 1.8.0 - rust 1.17.0-nightly (c0b7112ba 2017-03-02) - dmd 2.0.71.1 - ldc2 1.9.0 - ghc 7.10.3 (at /opt/ghc) - ocaml 4.06.1 - mono 5.12.0.226 # dynamic languages - luajit 2.0.4 - julia 0.6.3 - node 6.9.0 (at /opt/node) - dart 1.22.0 (at /usr/lib/dart) - wren 0.1.0 - elixir 1.6.5 (Erlang/OTP 20) Initialize tup init Compile ./compile-all.sh Compile opts: -O2 (gcc - applies to c/jni/nim) -C opt-level=2 (rust) Run ./run-all.sh 1000000 Measurement: call the c function "plusone" x number of times and print out the elapsed time in millis. int x = 0; while (x < count) x = plusone(x); 2 samples/runs Results (500M calls) ./run-all.sh 500000000 The results are elapsed time in milliseconds ============================================ luajit: 891 905 julia: 894 889 c: 1182 1182 cpp: 1182 1183 zig: 1191 1190 nim: 1330 1330 v: 1779 1781 rust: 1193 1196 d: 1330 1330 d ldc2: 1191 1189 haskell: 1197 1198 ocamlopt: 1634 1634 ocamlc: 4299 4302 csharp mono: 2697 2690 java7: 4469 4472 java8: 4505 4472 node: 9163 9194 node scoped: 15425 15409 go: 37975 37879 dart: 31265 31282 dart scoped: 61906 69043 wren: 14519 14514 elixir: 23852 23752
Read the full README on GitHub

What Hacker News says

10 sources
> I think of Julia and swift as higher-level languages, more domain-specific. Different tools for different problem domains. Well...my particular interest in these types of languages is primarily in the realm of soft real-time simulation, specifically various kinematic simulations. Of the three, only Julia is garbage collected, and (unlike some other GC languages) it's fairly easy to not exercise the collector. I'm encouraged that will continue to be the case, since there's an organization using it for robotics, which is implicitly a hard real time use case. http://www.juliarobotics.org/ Julia, Swift and Rust are all clearly general purpose languages. Swift is unabashedly general purpose, while Julia and Rust each have a primary niche - math/science and systems, respectively. All three use the excellent LLVM infrastructure. Aside from de
Read the rest
terminism (which mainly requires pre-allocating nearly everything), my primary requirements are expressiveness/productivity, readability, and efficient runtime performance. All three languages produce highly optimized code, and Rust probably has the edge as far as efficiency goes - but it clearly loses on the first two criteria, at least to Julia. If one needs access to machine level functionality in Julia, there's 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 continue to improve!
In A Rust FFI adventure in unsafety
good question! i'm not an expert. my understanding is go is slow because each function call has to copy over to a bigger stack (goroutines have tiny stacks to start, and grow on demand, but c code can't do that, natch) and because it has to tell the goroutine scheduler some stuff for hazy reasons. this github issue has a 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, which itself is about 2 times slower than just a plain c call.
In Getting to Go: Garbage collection and runtime issues

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.