ALL INTELLIGENCE
Hacker News AIT2·Tools

Krishiv 0.2 Runs TPC-H 10.4x Faster Than Spark on a Laptop

Original title: 10x faster than Spark on a laptop
58AI Score

Krishiv 0.2 ran 22 TPC-H-derived queries at SF100 (~100 GB) on a single laptop 10.4x faster than Apache Spark 4.2.0 by geometric mean (228 s vs 2,675 s), and completed all 22 queries at SF1000 (~1 TB) within a 20 GB memory cap. The authors acknowledge a faster embedded reference engine still exists on this workload, and the numbers cover one machine and one workload for a first release.

Related Entities

Full Report

Contents7 sections

On one laptop, with the same Parquet files, Krishiv 0.2 ran 22 queries derived from TPC-H at scale factor 100 (SF100, about 100 GB of data) 10.4 times faster than Apache Spark 4.2.0, measured as a geometric mean of per-query time. At SF1000 (about 1 TB) it completed all 22 queries inside a 20 GB memory limit. It is not the fastest engine on this workload: an embedded reference engine, named on the benchmarks page, is still faster today. Krishiv 0.2 is a first release, and these numbers describe one machine on one workload.

Key facts

FactValueMethod and version
Speed-up over Spark10.4x geometric mean22 queries derived from TPC-H, SF100, cold, two runs per query; Krishiv 0.2 (commit f345c5e) against Spark 4.2.0
Total time, SF100Krishiv 228 s, Spark 2,675 sall 22 queries; Spark with 12 shuffle partitions took 3,137 s
SF1000Krishiv completed 22 of 2220 GB engine memory limit, spilling to disk; the slowest (Q18) took 654 s. Spark (20 GB driver, 28 GB container) was run on Q01 to Q17 only: 6 finished inside the cap of 30 minutes per run, 11 did not; Q18 to Q22 were not run
Against the reference engineKrishiv is slower: 1.18x, 1.19x and 1.26x its timegeometric mean at SF10, SF100 and SF1000 (SF1000 over 21 queries, and its Q01 time is from an earlier run in which the reference engine had a 40 GB cap)
CorrectnessResults match the reference enginefull rows compared once; timed runs then checked by row count and checksum (row count only where a LIMIT can cut a tie: five queries at SF100 and four at SF1000): 22 of 22 at SF10 and SF100; 20 of 22 at SF1000, see the limits below. Spark's answers were not verified
MachineOne laptopi7-9750H, 12 threads, 64 GB RAM, NVMe SSD, Linux, powersave CPU governor
NotAn audited TPC-H resultderived from TPC-H; see the notice below

How fast is Krishiv 0.2 compared with Spark?

The benchmarks page has every number and its method. The short version, at SF100:

  • Geometric mean: 10.4x faster than Spark 4.2.0 (the gate build, commit f345c5e).
  • Total for all 22 queries: 228 seconds against 2,675 seconds.
  • Per query: Krishiv was faster than Spark on every query, from 5.0x on Q19 to 28.0x on Q01 (Q01 took 10.6 s against 298 s). The table below is the same gate run, so its times add up to the total above.

Krishiv 0.2 (the gate build, commit f345c5e) against Spark 4.2.0, 22 queries derived from TPC-H, SF100, cold runs:

QueryKrishiv 0.2Spark 4.2.0Spark / Krishiv
Q0110.6 s298 s28.0x
Q022.2 s34 s15.6x
Q0310.4 s110 s10.6x
Q046.2 s80 s12.9x
Q0512.6 s194 s15.5x
Q064.2 s31 s7.4x
Q0711.1 s89 s8.0x
Q0813.6 s139 s10.3x
Q0924.3 s262 s10.8x
Q1012.6 s81 s6.4x
Q112.1 s33 s15.7x
Q125.8 s55 s9.5x
Q1310.7 s74 s6.9x
Q147.7 s39 s5.0x
Q1513.2 s76 s5.7x
Q163.4 s50 s14.9x
Q1711.7 s296 s25.2x
Q1821.5 s281 s13.1x
Q197.8 s39 s5.0x
Q209.6 s50 s5.2x
Q2124.6 s340 s13.8x
Q222.1 s24 s11.6x

Spark was run in local[*] mode over Spark Connect, with a 20 GB driver and spark.sql.shuffle.partitions=24 and Spark 4 defaults otherwise. A run with 12 shuffle partitions was slower (3,137 s). Spark's times include the Spark Connect round trip.

What happens at SF1000, a terabyte of data?

At 1 TB the question is whether the engine finishes. Krishiv completed all 22 queries inside its 20 GB memory limit by spilling to disk; the slowest, Q18, took 654 seconds. Spark (20 GB driver, in a 28 GB container) was run on Q01 to Q17 only: 6 of those finished inside the cap of 30 minutes per run (Q02, Q06, Q11, Q12, Q13 and Q14) and 11 did not. Q18 to Q22 were not run.

With the same limit the reference engine was killed for memory on Q01 and Q18. Its Q01 time is from an earlier run with a 40 GB cap, where it used 35 GB; it has no Q18 time. Krishiv's Q01 and Q18 were then timed alone, outside the 28 GB container. Peak resident memory can exceed the engine limit: in the capped runs Krishiv peaked at 23.5 GiB (Q09) and the reference engine at 22.0 GiB (Q21), both inside the 28 GB container.

How was it measured?

ItemSetting
MachineOne laptop: i7-9750H, 12 threads, 64 GB RAM, NVMe SSD, Linux, powersave CPU governor
DataDerived from TPC-H, not audited: Parquet generated with tpchgen 3.0.0 (not dbgen) at SF10, SF100 and SF1000, read in place with no loading step
RunsCold: the dataset is evicted from the OS page cache before every run; two cold runs per query, one after the other, one engine at a time (not interleaved)
Limits12 threads and a 20 GB engine memory limit for Krishiv and the reference engine, inside a 28 GB cgroup; Spark driver memory 20g
VersionsKrishiv 0.2 (commit f345c5e); Apache Spark 4.2.0, local[*] over Spark Connect, spark.sql.shuffle.partitions=24; the reference engine at its 2.0.0 release
CorrectnessKrishiv's results match the reference engine's on the same data (full rows compared once, then row count and checksum; see the limits)

How do I reproduce the benchmark?

The harness and the engine configurations are in the repository.

BASH
git clone https://github.com/KrishivAI/krishiv-engine
cd krishiv-engine/bench
uv run krishiv-bench reproduce --suite tpch --sf 100

Your numbers will differ with your CPU, disk and memory; the ratio between engines on the same machine is the part to compare. If yours does not match, tell us on GitHub with the machine and the command.

What are the limits of these results?

  • First release. Krishiv 0.2 is the first release. The API is not stable before 1.0, and streaming, incrementally maintained views, Spark Connect and distributed execution are not part of it.
  • A reference engine is still faster. Krishiv's geometric-mean time is 1.18x, 1.19x and 1.26x that engine's at SF10, SF100 and SF1000. Per query at SF1000 it ranges from 0.59x on Q03 (Krishiv faster) to 2.61x on Q16 (Krishiv slower). That is the claim for one node: faster than Spark, behind the fastest embedded engine.
  • One machine, runs on different days. Two cold runs per query on one laptop, one engine after another: Spark's runs are from 10 November and Krishiv 0.2's from 12 and 13 November. Spark was not rerun for the release build. Spark on a cluster, or on a different node, will give a different ratio.
  • Correctness is checked against the reference engine, not against the official answer set. At SF1000, 20 of the 22 results matched a fresh run of the reference engine and Q01 matched an earlier one. Q18 is consistent across repeated Krishiv runs only, because the reference engine could not finish it within the limit. Spark's answers were not verified.
  • Q11 returns no rows at SF100 and SF1000. The query's filter fraction is not scaled by 1/SF, so at these scales both engines return an empty result; its time is still in the totals.
  • Not the audited benchmark. These queries are derived from the TPC-H benchmark. These are not TPC-H results: they are unaudited, and not comparable with published TPC results. TPC-H is a trademark of the Transaction Processing Performance Council.
  • One machine, batch only. The distributed, lakehouse and streaming benchmarks on the benchmarks page are marked as not yet run.

Where do I find out what Krishiv 0.2 ships?

This post is about the benchmark only. Introducing Krishiv 0.2 lists what ships and what does not, and the Spark alternative in Rust page says who Krishiv is for. To try it: pip install "krishiv[pyarrow]", then follow the quickstart.

Apache Spark and Spark are trademarks of the Apache Software Foundation. Krishiv is not affiliated with or endorsed by the Apache Software Foundation.

← All posts Filed under

Enjoyed this post? Star Krishiv on GitHub to follow along.