Skip to main content

Performance Characteristics

Parsing Performance

For a graph file with 100,000 edges:

MethodTimeNotes
JavaScript (regex/split)~800msGC pressure, regex overhead
WASM (Rust)~80msZero GC, tight loop
Improvement~10×Consistent across file sizes

WASM parsing also produces the adjacency map in the same pass, eliminating a second O(E) traversal that pure JS would require.

Why is WASM so much faster?

  1. No garbage collector — Rust's ownership model means zero GC pauses
  2. SIMD-eligible tight loops — the Rust compiler can auto-vectorize byte scanning
  3. No dynamic dispatch — statically typed, no prototype chain lookups
  4. Single-pass construction — edges and adjacency map built simultaneously

Node Style Computation

For 3,000 nodes on every animation tick:

MethodTime
JavaScript (Map lookups, string comparisons)~5–15ms
WASM (HashMap + inline color assignment)~0.5–2ms

At 100ms animation ticks, JS computation isn't a bottleneck. At 40ms (fast mode), WASM ensures the animation loop stays smooth on slower devices.

MPI Communication Overhead

For a 10,000-node, 50,000-edge graph:

PhaseTime
Serialization (bincode)~5ms
Network transfer (local Docker bridge)~2ms
Deserialization~5ms
Total MPI overhead~12ms per request

Algorithm computation time dominates (50–500ms depending on algorithm). MPI overhead is negligible for meaningful graph sizes.

WebGL Rendering

Reagraph uses Three.js WebGL rendering. On a typical discrete GPU:

Graph SizeFramerate
500 nodes, 2,000 edges~60 FPS
3,000 nodes, 10,000 edges~30–45 FPS (layout stabilizing)

Node label rendering is automatically disabled above 60 nodes to maintain performance.

Algorithm Runtimes

Approximate execution times on the MPI cluster (1 master + 1 worker) for various graph sizes:

Algorithm1K nodes10K nodes100K edges
BFS / DFS<1ms~5ms~50ms
Dijkstra~2ms~20ms~200ms
Bellman-Ford~5ms~200ms~2s
Kruskal MST~3ms~30ms~300ms
PageRank (30 iter)~5ms~50ms~500ms
SCC (Kosaraju)~2ms~15ms~150ms

Times include bincode serialization and MPI transfer.

Browser Memory Usage

ComponentMemory
WASM module (loaded)~4MB
3,000-node parsed graph~2–5MB
Reagraph WebGL scene~20–50MB (GPU-resident)
Total typical usage~60–80MB

Optimization Tips

For Large Graphs

  • Pre-filter your graph to under 3K nodes for best visualization performance
  • Use edge list format — simpler format, fewer string operations per line
  • Close other browser tabs — WebGL is GPU-intensive; competing GPU usage hurts framerate

For Slow Animation

  • Switch from Fast (40ms) to Medium (100ms) or Slow (280ms) animation speed
  • Disable the force-directed layout stabilization by switching to Circular or Radial layout

For API Throughput

  • The /graph_metrics endpoint is much faster than /process_file — use it for quick analysis
  • For repeated runs on the same graph, upload once and use the browser's cached file