Abstract
Datalog has experienced a resurgence in fields such as program analysis and graph processing. However, a deep understanding of why specific Datalog engines outperform others on certain tasks remains elusive. This paper introduces a comprehensive profiling framework to analyze recursive computations, revealing how data characteristics—such as recursion depth and fact production—interact with system design choices like indexing and memory management. By comparing three prominent engines (Soufflé, DDlog, and RecStep), we identify key performance bottlenecks and trade-offs between incremental and batch processing strategies.
Introduction
The "Datalog Renaissance" has yielded several high-performance engines, including Soufflé, DDlog, and RecStep. Despite their success, performance evaluations often rely on "hero numbers" that demonstrate speed on specific benchmarks without explaining the underlying causes. A system optimized for static program analysis may perform poorly on large social network graphs. To bridge this gap, we present a profiling framework that examines the recursive evaluation process, providing insights into CPU utilization, memory consumption, and fact generation patterns.
Profiling Methodology
Our framework evaluates Datalog systems across four dimensions:
- Recursion Profile: Tracks Generated Facts (GF), Unique Generated Facts (UGF), and New Facts (NF) per iteration. This "fingerprint" reveals the efficiency of deduplication.
- Runtime Breakdown: Separates compilation time from evaluation time.
- CPU Utilization: Measures the effectiveness of multi-core parallelism.
- Memory Consumption: Monitors the memory footprint throughout execution to identify bottlenecks in state maintenance or pre-allocation.
Experimental Setup
We evaluated three single-node systems: Soufflé (specialized data structures), DDlog (incremental computation), and RecStep (relational database engine). Datasets included synthetic random graphs, large social networks (LiveJournal, Orkut, Twitter), and complex program analysis tasks (Linux, PostgreSQL).
Key Insights and Performance Analysis
The Recursion "Fingerprint"
The gap between Generated Facts and Unique Generated Facts indicates the overhead of duplicate production. A large gap suggests that deduplication is a primary bottleneck. As seen in the recursion profiles (e.g., Figure 3a), different workloads exhibit vastly different fingerprints, influencing which engine is most suitable.
Incremental vs. Batch Trade-offs
While DDlog excels at incremental updates, it faces significant overhead in batch processing. To support potential new inputs, it maintains massive intermediate states, leading to memory consumption and evaluation times often 2–3x higher than competitors.
The "Long Tail" and Indexing Overhead
Workloads like Dataflow Analysis (CSDA) often feature a "long tail" of iterations with minimal work. Systems like RecStep, which may rebuild hash tables per iteration, suffer in these scenarios. Conversely, Soufflé’s specialized structures offer excellent compression but can encounter bottlenecks during initial index construction on large, sparse graphs.
Results Summary
- Soufflé provides the best overall balance for program analysis due to its parallel data structures, though high compilation times can be a drawback for one-off tasks.
- RecStep excels in Reachability tasks on large sparse graphs where recursion depth is low, avoiding the heavy "warm-up" indexing phase required by other engines.
- DDlog exhibits the highest overhead, with compilation times frequently reaching ~200 seconds, making it less ideal for non-incremental batch workloads.
- Parallel Efficiency: Performance drops are often linked to low CPU utilization during indexing phases or the "long tail" of recursion.
Conclusion and Future Work
Current profiling reveals that system performance is deeply tied to the interaction between data characteristics and engine design. Future work aims to use these profiles to predict recursion behavior a priori, allowing for automatic engine selection. We also advocate for a standardized Datalog benchmark suite to facilitate more rigorous cross-system comparisons.
Summary updated