Commit d1accf2c authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

fixups

parent 07836384
...@@ -251,7 +251,7 @@ impl Effect { ...@@ -251,7 +251,7 @@ impl Effect {
} }
} }
/// Normalizes all contained values. /// Returns all JsValues referened by this effect. (Intended for debugging purposes.)
pub fn values(&self) -> Vec<&JsValue> { pub fn values(&self) -> Vec<&JsValue> {
match self { match self {
Effect::Call { func, args, .. } => { Effect::Call { func, args, .. } => {
......
...@@ -980,12 +980,14 @@ pub async fn analyse_ecmascript_module_internal( ...@@ -980,12 +980,14 @@ pub async fn analyse_ecmascript_module_internal(
} }
} }
} }
if !histogram.is_empty() {
let scale = 150f32 / (*histogram.iter().max().unwrap() as f32); let scale = 150f32 / (*histogram.iter().max().unwrap() as f32);
for (i, count) in histogram.into_iter().enumerate() { for (i, count) in histogram.into_iter().enumerate() {
let bar = "*".repeat((count as f32 * scale) as usize); let bar = "*".repeat((count as f32 * scale) as usize);
println!("{i:3}: {bar} ({count})"); println!("{i:3}: {bar} ({count})");
} }
} }
}
let span = tracing::info_span!("effects processing", count = var_graph.effects.len()); let span = tracing::info_span!("effects processing", count = var_graph.effects.len());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment