Performance Improvements in Libffi

(atgreen.github.io)

Comments

rurban 21 June 2026
Oh, I thought he does this already. Why was there a prepare, when it doesnt prepare the arg decoding.
quotemstr 1 hour ago
Bytecode is an awesome trick and gets used in a surprising number of situations. In Windows COM, for example, (for IPC and serialization), stubs and proxies do their marshaling by interpreting a small bytecode generated from type and signature descriptions. You end up with an artifact smaller and more convenient than AOT-compiled native code and it doesn't hurt performance in any practical way.

Notably, the COM bytecode covers not only procedure-level argument-passing, but data structure transformations themselves. It's a nice setup.

tadfisher 21 June 2026
Can we AOT-compile stubs instead of interpreting or JIT-compiling? I feel like most FFI users would call static, well-defined functions.