A month ago I wrote about a new libffi API that lets a caller build the argument-placement plan once and reuse it, instead of re-deriving it on every ffi_call.

I’m happy to see Christian Hergert put it to work in GLib. He caches the plan for GClosure invocation and measures it up to 25 percent faster in the best case, and still around 10 percent when conditions are less than ideal.

That’s exactly what I hoped would happen: build the thing once, and let it save the work on every call after.