HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Glavo
java-ffi-benchmark
C++2023–2026
Glavo / java-ffi-benchmark

java-ffi-benchmark

Discover this repository through its Hacker News conversations.

2Distinct people
2Mentions
0Explicit recommenders
58GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:24:10 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 year2 dated mentions

Observed mentions: 2023-12-04 19:47:48 UTC to 2026-08-04 17:17:12 UTC.

012023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

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
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

2 sources
Yes, I would have said JNI (and JNI still exists). But FFM is much more than a wrapper. In most situations it offers a significant performance boost over JNI. E.g. see https://github.com/Glavo/java-ffi-benchmark, which is a bit out of date, and FFM is even better now especially in the cases it was behind in those benchmarks. Also, the integrity story is different for them. JNI is able to arbitrarily call Java methods and read/write variables, bypassing Java's access control. FFM doesn't. So really, the only integrity issue with FFM is the native code's own memory safety. With JNI, there are bigger risks (e.g. JNI can mutate Java strings).
In Zig's Incremental Compilation Internals
Declaring and calling a C method in C# is as trivial as [LibraryImport("my_library", EntryPoint = "pass_numbers")] partial static void PassNumbers(int a, int b, int c); For AOT compilation, you can even completely statically link[0] it into the binary and annotate with [SuppressGCTransition] - it will be as cheap as a direct call from C++ (although GC transition is just a helper stub call that is barely noticeable on microbenchmarks - 1-2ns difference at throughput). In fact, you can also do the reverse and AOT-compile C# projects to regular dll/libs which can be called from C, C++, Rust, etc. land with ease: [UnmanagedCallersOnly(EntryPoint = "receive_c_string")] public unsafe static void ReceiveCString(byte* ptr) { /* impl.. */ } (there are other aspects that make this a powerful combo like being able to wrap pointers
Read the rest
into new Span<byte>(ptr, length)'s and transparently inter-operating with most of the standard library without ever allocating) Panama may offer better UX but not the one that can match C# and only marginally improves performance over JNI[1] (which is still slow). [0] https://learn.microsoft.com/en-us/dotnet/core/deploying/nati... [1] https://github.com/Glavo/java-ffi-benchmark
In Project Valhalla: A look inside Java's epic refactor

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.