Skip to content

Commit

Permalink
Merge pull request #15 from JonasAlaif/gviz
Browse files Browse the repository at this point in the history
graphviz settings to improve performance
  • Loading branch information
oskari1 authored Dec 2, 2023
2 parents 89f1bb7 + bea6bfa commit 0039ade
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions axiom-profiler-GUI/src/results/svg_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,21 @@ impl Component for SVGResult {
self.graph_dim.prev_edge_count = Some(edge_count);
log::debug!("Rendering graph");
let filtered_graph = &self.inst_graph.visible_graph;
// let filtered_graph = &self.inst_graph.inst_graph;

// Performance observations (default value is in [])
// - splines=false -> 38s | [splines=true] -> ??
// - nslimit=2 -> 7s | nslimit=4 -> 9s | nslimit=7 -> 11.5s | nslimit=10 -> 14s | [nslimit=INT_MAX] -> 38s
// - [mclimit=1] -> 7s | mclimit=0.5 -> 4s (with nslimit=2)
// `ranksep` dictates the distance between ranks (rows) in the graph,
// it should be set dynamically based on the average number of children
// per node out of all nodes with at least one child.
let settings = ["ranksep=1.0;", "splines=false;", "nslimit=6;", "mclimit=0.6;"];
let dot_output = format!(
"{:?}",
"digraph {{\n{}\n{:?}\n}}",
settings.join("\n"),
Dot::with_attr_getters(
filtered_graph,
&[Config::EdgeNoLabel, Config::NodeNoLabel],
&[Config::EdgeNoLabel, Config::NodeNoLabel, Config::GraphContentOnly],
&|_, edge_data| format!(
"style={}",
match edge_data.weight().edge_type {
Expand Down

0 comments on commit 0039ade

Please sign in to comment.