1+ use std:: time:: Instant ;
2+
13use apollo_class_manager_config:: config:: { ClassManagerConfig , FsClassManagerConfig } ;
24use apollo_class_manager_types:: {
35 ClassHashes ,
@@ -15,7 +17,7 @@ use apollo_compile_to_casm_types::{
1517use apollo_infra:: component_definitions:: { default_component_start_fn, ComponentStarter } ;
1618use async_trait:: async_trait;
1719use starknet_api:: state:: { SierraContractClass , CONTRACT_CLASS_VERSION } ;
18- use tracing:: instrument;
20+ use tracing:: { debug , instrument} ;
1921
2022use crate :: class_storage:: { CachedClassStorage , ClassStorage , FsClassStorage } ;
2123use crate :: metrics:: register_metrics;
6062 return Ok ( ClassHashes { class_hash, executable_class_hash_v2 } ) ;
6163 }
6264
65+ let compilation_start_time = Instant :: now ( ) ;
6366 let ( raw_executable_class, executable_class_hash_v2) =
6467 self . compiler . compile ( class. clone ( ) ) . await . map_err ( |err| match err {
6568 SierraCompilerClientError :: SierraCompilerError ( error) => {
6972 ClassManagerError :: Client ( error. to_string ( ) )
7073 }
7174 } ) ?;
75+ debug ! (
76+ %class_hash,
77+ compiled_class_hash = %executable_class_hash_v2,
78+ compilation_elapsed_ms = compilation_start_time. elapsed( ) . as_millis( ) ,
79+ class_size_bytes = class. size( ) . map( |size| size. to_string( ) ) . unwrap_or( "Failed to get class size" . to_owned( ) ) ,
80+ casm_size_bytes = raw_executable_class. size( ) . map( |size| size. to_string( ) ) . unwrap_or( "Failed to get casm size" . to_owned( ) ) ,
81+ "Finished compiling class."
82+ ) ;
7283
7384 self . validate_class_length ( & raw_executable_class) ?;
7485 Self :: validate_class_version ( & sierra_class) ?;
0 commit comments