We could greatly improve the code generated when compiling cmo files if we knew the arity of the functions exported by each module.
This information could be stored in a separate file for each module compiled when the --dynlink option is used, or when compiling cmo and cma files.