Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add timing log to check_database #14667

Merged
merged 5 commits into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib/transition_frontier/transition_frontier.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ let load_from_persistence_and_start ~context:(module Context : CONTEXT)
(Precomputed_values.genesis_state_hashes precomputed_values).state_hash
}

let time ~logger ~label f =
let start = Time.now () in
let x = f () in
let stop = Time.now () in
[%log info] "%s took %s" label
(Time.Span.to_string_hum (Time.diff stop start)) ;
x

let rec load_with_max_length :
context:(module CONTEXT)
-> max_length:int
Expand Down Expand Up @@ -283,6 +291,8 @@ let rec load_with_max_length :
~snarked_ledger_hash:genesis_ledger_hash
in
match
time ~label:"Persistent_frontier.Instsance.check_database" ~logger
@@ fun () ->
Persistent_frontier.Instance.check_database
~genesis_state_hash:
(State_hash.With_state_hashes.state_hash
Expand Down