TL;DR
This paper introduces EmptyHeaded, a novel graph processing engine that bridges the gap between high-level, user-friendly query languages and the high performance of low-level, imperative graph engines. By leveraging generalized hypertree decompositions (GHDs) for query planning and a sophisticated execution engine optimized for SIMD parallelism and data skew, EmptyHeaded achieves performance comparable to specialized engines while offering a much more accessible programming model.
What Problem Does This Paper Address?
The field of graph processing faces a fundamental trade-off: low-level engines (like Galois, PowerGraph) offer high performance but require users to write complex, imperative code, placing the burden of optimization on them. High-level engines (using languages like Datalog or SQL) are much easier to use but historically suffer from significant performance penalties, often orders of magnitude slower than their low-level counterparts. This gap stems from the inherent difficulty of optimizing multi-way joins, a core operation in graph queries, within traditional relational frameworks and the challenge of efficiently exploiting modern hardware parallelism (like SIMD) on highly skewed graph data. EmptyHeaded aims to resolve this by providing a high-level relational interface that achieves performance competitive with specialized low-level engines.
Methods
EmptyHeaded's core innovation lies in its architecture, which combines a novel query compiler and an optimized execution engine:
- Query Compiler with Generalized Hypertree Decompositions (GHDs): Instead of traditional relational algebra, EmptyHeaded uses GHDs as its logical query plan. GHDs are tree-like structures that represent multi-way joins and allow for tighter theoretical bounds on intermediate result sizes. This enables optimizations like early aggregation, which are crucial for performance. The compiler automatically selects the "optimal" GHD for a given query.
- Optimized Execution Engine with SIMD Parallelism and Data Layouts: The engine is designed to exploit Single Instruction, Multiple Data (SIMD) parallelism. A key challenge is handling data skew (variations in data density and cardinality). EmptyHeaded employs an optimizer that dynamically selects between different data layouts (e.g., uint for sparse data, bitsets for dense data) and intersection algorithms at various granularities (relation, set, block) to maximize SIMD utilization. This adaptive approach is critical for achieving high performance on real-world, skewed graph data.
Datasets
The paper evaluates EmptyHeaded on several popular graph datasets:
- Google+
- Higgs
- LiveJournal
- Orkut
- Patents
These datasets vary in size and density skew, allowing the authors to demonstrate the effectiveness of their optimizations across different graph characteristics. The paper does not introduce new benchmarks but uses standard graph analytics workloads like triangle counting, PageRank, and Single-Source Shortest Paths (SSSP).
Key Insights and Ideas
- GHDs as a Bridge: Generalized Hypertree Decompositions are not just a theoretical construct but a practical tool for enabling high-level query optimization in graph processing, allowing for better cardinality estimates and early aggregation.
- SIMD is Key, but Skew is the Enemy: While SIMD parallelism offers massive speedups, its effectiveness is severely hampered by data skew. EmptyHeaded's core contribution is a sophisticated system that automatically adapts to this skew by choosing the right data structures and algorithms.
- The Power of Adaptive Layouts: The decision of whether to use sparse (uint) or dense (bitset) layouts for data structures is not static. EmptyHeaded's set-level optimization, which dynamically chooses layouts per set based on its characteristics, provides significant performance gains, outperforming relation-level or block-level decisions in many cases.
- High-Level Doesn't Have to Mean Slow: The paper demonstrates that with the right architecture, a high-level relational interface can achieve performance competitive with specialized, low-level graph engines, making graph analytics more accessible without sacrificing speed.
Key Results
- Graph Pattern Queries: EmptyHeaded outperforms specialized graph engines by 2-60x on cyclic graph pattern queries and up to 3 orders of magnitude faster than LogicBlox.
- PageRank: Consistently 2-4x faster than standard low-level baselines and over an order of magnitude faster than high-level baselines. It is competitive with highly tuned low-level engines like Galois.
- SSSP: Outperforms PowerGraph and SociaLite by an order of magnitude and LogicBlox by three orders of magnitude. It is competitive with Galois, though Galois's specialized implementation is 2-30x faster.
- Optimizer Impact: The combined optimizations (GHDs and SIMD layout/algorithm choices) can lead to performance improvements of up to three orders of magnitude on complex graph pattern queries. Disabling these optimizations significantly degrades performance.
Limitations and Future Work
- GHD Optimization Complexity: While GHDs enable better optimization, finding the optimal GHD is NP-hard. EmptyHeaded currently uses brute-force search for smaller queries and heuristics for larger ones.
- Data Loading and Indexing: The paper focuses on query execution performance and does not deeply explore the overhead of data loading or index creation, though it mentions that EmptyHeaded's compilation process is fast.
- Future Work: The authors suggest exploring more sophisticated GHD optimization techniques, further investigating the interplay between data layouts and SIMD parallelism, and extending the engine to handle more complex query features and distributed environments. They also aim to unify standard SQL and graph processing engines.
Summary updated