package ocaml-base-compiler

  1. Overview
  2. Docs

Compiler performance recording

type file = string
type source_provenance =
  1. | File of file
  2. | Pack of string
  3. | Startup
  4. | Toplevel
type compiler_pass =
  1. | All
  2. | Parsing of file
  3. | Preprocessing of file
  4. | Typing of file
  5. | Transl of file
  6. | Generate of file
  7. | Assemble of source_provenance
  8. | Clambda of source_provenance
  9. | Cmm of source_provenance
  10. | Compile_phrases of source_provenance
  11. | Selection of source_provenance
  12. | Comballoc of source_provenance
  13. | CSE of source_provenance
  14. | Liveness of source_provenance
  15. | Deadcode of source_provenance
  16. | Spill of source_provenance
  17. | Split of source_provenance
  18. | Regalloc of source_provenance
  19. | Linearize of source_provenance
  20. | Scheduling of source_provenance
  21. | Emit of source_provenance
  22. | Flambda_pass of string * source_provenance
val reset : unit -> unit

erase all recorded times

val get : compiler_pass -> float option

returns the runtime in seconds of a completed pass

val time : compiler_pass -> ('a -> 'b) -> 'a -> 'b

time pass f arg Record the runtime of f arg

val accumulate_time : compiler_pass -> ('a -> 'b) -> 'a -> 'b

Like time for passes that can run multiple times

val print : Format.formatter -> unit

Prints all recorded timings to the formatter.

OCaml

Innovation. Community. Security.