Skip to content

Commit

Permalink
Add cache information to mpipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
3Rafal committed Dec 5, 2023
1 parent bebff9e commit d3ec88e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/kernel/mpipeline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,13 @@ let timing_information t = [
"typer" , !(t.typer_time);
"error" , !(t.error_time);
]

let cache_information t =
let phase = ("phase", [
"reader" , !(t.reader_cache_hit);
"ppx" , !(t.ppx_cache_hit);
]) in
let cmt = ("cmt", Cmt_cache.get_cache_stats ()) in
let cmi = ("cmi", Cmi_cache.get_cache_stats ()) in
let () = Cmt_cache.clear_cache_stats (); Cmi_cache.clear_cache_stats () in
[phase; cmt; cmi]
1 change: 1 addition & 0 deletions src/kernel/mpipeline.mli
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ val typer_result : t -> Mtyper.result
val typer_errors : t -> exn list

val timing_information : t -> (string * float) list
val cache_information : t -> (string * (string * bool) list) list

0 comments on commit d3ec88e

Please sign in to comment.