TL;DR
Dynamic graph processing faces a fundamental conflict between efficient computation (requiring contiguous data) and efficient updates (favoring linked structures). GastCoCo tackles this by co-designing a prefetch-aware data structure (CBList) with coroutine-based software prefetching, significantly reducing cache misses and outperforming state-of-the-art systems in both graph updates and computations.
What Problem Does This Paper Address?
The world is increasingly reliant on dynamic graphs – graphs that change frequently, like social networks or recommendation systems. Processing these graphs efficiently requires a delicate balance: graph computations (like PageRank) perform best when data is laid out contiguously in memory for fast access, while graph updates (adding or removing edges/vertices) are easiest with linked structures that allow for quick modifications without moving large blocks of data. Traditional graph storage structures either excel at one at the expense of the other, or offer a compromise that sacrifices performance in both. This paper identifies that a major bottleneck in dynamic graph processing is cache misses, and proposes a novel approach to mitigate this issue.
Methods
GastCoCo's core innovation lies in its co-design of a new data structure, CBList, and a coroutine-based prefetching mechanism.
- CBList (Cache-friendly and Block-based List): This data structure aims to be "prefetch-friendly." It uses a hierarchical approach:
- Small Chunks: For low-degree vertices, neighbors are stored in small, contiguous blocks aligned with cache line sizes.
- B+ Trees: For high-degree vertices, B+ trees are used to store neighbors. This provides a balance between update efficiency and maintaining some level of locality.
- Global Traversal Chain (GTChain): A linked list connecting neighborhoods of vertices with adjacent logical IDs, enabling sequential traversal and better hardware prefetching.
- Coroutine-Based Software Prefetching: GastCoCo leverages C++20 stackless coroutines to implement software prefetching. Instead of waiting for data to be fetched after a cache miss, a coroutine can issue a prefetch instruction and then "yield" to another coroutine to perform computation. This interleaves data loading and computation, effectively hiding the latency of cache misses.
- Hybrid Prefetching Strategies: GastCoCo combines hardware prefetching (which the CPU does automatically) with its software prefetching. It employs strategies to avoid redundant prefetches, either relying on hardware prefetching for "hot" data or using software prefetching for "cold" data or at the start of linked lists where hardware prefetching might struggle.
- Execution Strategy Tuner: An adaptation layer dynamically tunes partitioning and scheduling strategies based on the specific graph task and hardware environment to optimize performance.
Datasets
The paper evaluates GastCoCo on several real-world graph datasets:
- Social Networks: Livejournal, Hollywood, Com-friendster
- Web Graphs: UK-2002, Orkut
- Dynamic Datasets: SNB-sf1000 (for simulating real-world updates with deletions), Ogbl-citation2 (for graph attribute updates).
The datasets were shuffled to simulate realistic dynamic graph processing scenarios.
Key Insights and Ideas
- Cache misses are the primary performance killer: The paper's experimental analysis strongly suggests that cache misses are a dominant factor in the performance degradation of dynamic graph processing, even with existing "halfway-house" data structures.
- Co-design is crucial: Simply improving the data structure or the prefetching technique in isolation isn't enough. GastCoCo's success comes from the tight integration of a prefetch-aware data structure (CBList) with a sophisticated coroutine-based prefetching mechanism.
- Coroutines are a lightweight solution for interleaving: C++20 stackless coroutines provide an efficient way to suspend and resume tasks, enabling the interleaving of data loading and computation without the heavy overhead of traditional threads.
- Hardware prefetching has limitations: While useful, hardware prefetchers struggle with non-contiguous data structures like linked lists and trees, creating an opportunity for software prefetching to shine.
- Dynamic graph processing needs a unified approach: The paper demonstrates that a single system can achieve excellent performance across both graph computation and graph updates, overcoming the traditional trade-offs.
Key Results
GastCoCo demonstrates significant performance improvements over state-of-the-art systems:
- Graph Updates: Outperforms competitors by 1.3x to 180x.
- Graph Computation: Achieves speedups of 1.4x to 41.1x.
- Query Execution: Shows an average speedup of 13.7x over Terrace and up to 20.4x over GraphOne.
- Cache Misses: Interleaved execution with software prefetching and hybrid strategies significantly reduces cache misses (up to 35% for graph algorithms) and cache stall percentages.
Limitations and Future Work
- Batch Updates: The coroutine optimization scheme is primarily effective for batch edge updates. Individual updates still rely on the inherent efficiency of CBList but don't benefit from the interleaved execution mode.
- Hybrid Strategy Tuning: Hybrid strategy II (based on hotness) requires iterative tuning to determine optimal thresholds for switching between hardware and software prefetching, making it more suitable for scenarios where repeated fine-tuning is feasible.
- GTChain Usage: The GTChain partition strategy is most effective for tasks involving sequential access to the entire graph (e.g.,
scan_verticeswithscan_edges).
The paper suggests that further research could explore more advanced scheduling and adaptation strategies to further optimize performance across a wider range of dynamic graph processing scenarios.
Summary updated