4 ms·
A lot of the closure creation costs can be eliminated by writing the library in a continuation-passing style, which shoves all of the data into proper arguments
by thedufer 8y ago
A lot of the closure creation costs can be eliminated by writing the library in a continuation-passing style, which shoves all of the data into proper arguments, bypassing the need for the closure. Of course, the user of the library is still likely to generate closures.
The implementation of this I'm most familiar with is OCaml's angstrom library.