A walkthrough of using Grafana Alloy's eBPF-based profiler and Pyroscope to analyze C++ performance bottlenecks in TON blockchain validator code. Using flame graphs and diffs, the team identified hotspots like SHA256 hashing (14% of execution time) and Ed25519 signature verification. Key optimizations included swapping crypto libraries (1.5–3.5% gains), consolidating SHA256 feed calls (20% speedup on DataCell::create), and replacing std::map with std::unordered_set (10% speedup). The post also highlights how eBPF profiling eliminates the need for custom instrumentation code, contrasting it with the manual tracing and memory profilers contestants built themselves.

7m read timeFrom grafana.com
Post cover image
Table of contents
First, some background on the contestAlloy setup

Sort: