Closed gasche closed 6 years ago
I'm not sure about this, I'll look into it tomorrow.
I asked @lpw25 about this and there is a good reason when an intrinsic has a type-directed specialization, which I believe is the case for both the safe and unsafe get
/set
operations. This is consistent with performance I did with versions of this library that were included in angstrom and faraday. Specifically, I saw C calls to caml_ba_get_1
and related functions in perf
output when doing load testing.
I have seen pain caused by exporting
external
instead ofval
in a.mli
(you cannot later define to redefine the functions in a slightly different way, for example to expose a different exception in the failure case; in general this makes the interface less flexible), and never heard of any tangible performance gain in presence of reasonable inlining.Is it a conscious choice to expose
external
s in the interface, or would you useval
just as well?