diff --git a/Cargo.toml b/Cargo.toml index 484c1fe..31ce4ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,4 +2,10 @@ resolver = "2" members = [ "sierra-decompiler", -] \ No newline at end of file +] + +[profile.dev] +opt-level = 0 + +[profile.release] +opt-level = 3 diff --git a/lib/src/decompiler/decompiler.rs b/lib/src/decompiler/decompiler.rs index 9db9426..e9814a2 100644 --- a/lib/src/decompiler/decompiler.rs +++ b/lib/src/decompiler/decompiler.rs @@ -630,6 +630,7 @@ impl<'a> Decompiler<'a> { } /// Generate a callgraph representation in DOT Format + #[inline] pub fn generate_callgraph(&mut self) -> String { process_callgraph(&self.functions) } diff --git a/lib/src/decompiler/libfuncs_patterns.rs b/lib/src/decompiler/libfuncs_patterns.rs index e8eddef..4bf2fac 100644 --- a/lib/src/decompiler/libfuncs_patterns.rs +++ b/lib/src/decompiler/libfuncs_patterns.rs @@ -55,7 +55,6 @@ lazy_static! { // Used to match and replace them in remote contracts pub static ref TYPE_ID_REGEX: Regex = Regex::new(r"(?\[[0-9]+\])").unwrap(); - // User-defined type ID // User defined types IDs are the 250 first bits of the id name Keccak hash // https://github.com/starkware-libs/cairo/blob/b29f639c2090822914f52db6696d71748a8b93a6/crates/cairo-lang-sierra/src/ids.rs#L118 pub static ref USER_DEFINED_TYPE_ID_REGEX: Regex = Regex::new(r"ut@\[(?[0-9]+)\]").unwrap(); diff --git a/lib/src/decompiler/utils.rs b/lib/src/decompiler/utils.rs index a476316..46e46b8 100644 --- a/lib/src/decompiler/utils.rs +++ b/lib/src/decompiler/utils.rs @@ -6,6 +6,7 @@ use crate::decompiler::libfuncs_patterns::USER_DEFINED_TYPE_ID_REGEX; /// Convert an integer to it's string value or hex value /// Used to decode consts +#[inline] pub fn decode_hex_bigint(bigint: &BigInt) -> Option { // Convert the BigInt to a hexadecimal string let hex_string = format!("{:x}", bigint);