3 ms·
It would be interesting to see how the speed of -ppx extensions compares to camlp4. If camlp4 is run in bytecode mode it can be quite slow, I looked at 'top' wh
by edwintorok 12y ago
It would be interesting to see how the speed of -ppx extensions compares to camlp4.
If camlp4 is run in bytecode mode it can be quite slow,
I looked at 'top' while running 'opam install core' at some point, and most of the time was taken by camlp4.
Since -ppx extensions are supposed to run natively (without requiring natdynlink support even) I would expect them to be faster.
Has anyone done any comparisons?
- avsm 12y agoThere are pros and cons to not using dynlink, since it requires another fork (although this can be avoided using a custom compiler driver). Avoiding bytecode in the compilation toolchain is really the main benefit though. This was originally due to the fact that only the bytecode backend supported dynamic loading (which is used by camlp4 to load the syntax extension modules). When native dynamic code loading was added to OCaml circa 2009 or so, the build systems around camlp4 never really took up the change to switch to the much faster native code version. All the ppx extensions emerging now are at least guaranteed to have a native code version on all the major supported architectures (x86, ARM, Sparc, PPC)