diff --git a/infer/src/IR/Tenv.ml b/infer/src/IR/Tenv.ml index 2434b2a35..1a08de65d 100644 --- a/infer/src/IR/Tenv.ml +++ b/infer/src/IR/Tenv.ml @@ -174,11 +174,13 @@ let store_to_filename tenv tenv_filename = let store_global tenv = (* update in-memory global tenv for later uses by this process, e.g. in single-core mode the frontend and backend run in the same process *) - L.debug Capture Quiet "Tenv.store: global tenv has size %d bytes.@." - (Obj.(reachable_words (repr tenv)) * (Sys.word_size / 8)) ; + if Config.debug_level_capture > 0 then + L.debug Capture Quiet "Tenv.store: global tenv has size %d bytes.@." + (Obj.(reachable_words (repr tenv)) * (Sys.word_size / 8)) ; let tenv = TypenameHashNormalizer.normalize tenv in - L.debug Capture Quiet "Tenv.store: canonicalized tenv has size %d bytes.@." - (Obj.(reachable_words (repr tenv)) * (Sys.word_size / 8)) ; + if Config.debug_level_capture > 0 then + L.debug Capture Quiet "Tenv.store: canonicalized tenv has size %d bytes.@." + (Obj.(reachable_words (repr tenv)) * (Sys.word_size / 8)) ; global_tenv := Some tenv ; store_to_filename tenv global_tenv_path diff --git a/infer/src/backend/mergeCapture.ml b/infer/src/backend/mergeCapture.ml index 9ce6b26df..88b0bfbad 100644 --- a/infer/src/backend/mergeCapture.ml +++ b/infer/src/backend/mergeCapture.ml @@ -23,8 +23,10 @@ let merge_global_tenvs infer_deps_file = Tenv.read global_tenv_path |> Option.iter ~f:(fun tenv -> Tenv.merge ~src:tenv ~dst:global_tenv) in Utils.iter_infer_deps ~project_root:Config.project_root ~f:merge infer_deps_file ; + let time1 = Mtime_clock.counter () in Tenv.store_global global_tenv ; - L.progress "Merging type environments took %a@." Mtime.Span.pp (Mtime_clock.count time0) + L.progress "Merging type environments took %a, of which %a were spent storing the global tenv@." + Mtime.Span.pp (Mtime_clock.count time0) Mtime.Span.pp (Mtime_clock.count time1) let merge_json_results infer_out_src json_entry =