SQLite Forum

Benchmarking SQLite on Apple's M1 ?

Benchmarking SQLite on Apple's M1 ?

(1) By Simon Slavin (slavin) on 2021-12-02 12:53:32 [link] [source]

Triggered by Will Iverson's post about compiling for the M1 …

The codebase for SQLite is highly optimised, and written in C which is well suited to RISC optimisation. So compilation for the RISC platform of x86_64 should indeed produce 'crazy fast' results. Also, the M1 Macs are 'system-on-a-chip', which means that I/O operations aren't subject to such bad timing delays as they move around a motherboard. Since for most uses SQLite is I/O bound, this will also make a difference.

This should mean that SQLite running on M1 Macs should yield fast results. I have access to both the first M1 Pro MacBook Pro, and the last generation of Intel MacBook Pros, and was interested in comparative benchmarks. But I realised I didn't know enough to figure out what compilation command-line to use, or what suite to run as a benchmark. So I'm hoping someone else will do it. Or perhaps there's a document somewhere which lays out how to benchmark SQLite.

If this is what you were doing in the first place, Will, I'd love to see your results.

(2) By Richard Hipp (drh) on 2021-12-02 13:26:10 in reply to 1 [link] [source]

Perhaps the simplest performance measurement:

CFLAGS=-Os ./configure
make speedtest1

I find that the single-core performance of the Apple M1 CPUs is faster than a 2.2 GHz Ryzen 7 3700X but slower than a 2.2 GHz Ryzen 9 5950X. All of these are faster than the 3.6GHz i9-9900K in the last of the intel iMacs, at least according to measurements on the machines I have easily at hand.

(3) By Simon Slavin (slavin) on 2021-12-02 16:57:49 in reply to 2 [link] [source]

Well that's great. Someone else did all the work.

I find the slot between Ryzen 7 and Ryzen 9 interesting. I didn't know what to expect.

(7) By Marco Bubke (marcob) on 2021-12-04 11:44:32 in reply to 3 [source]

Could Sqlite profit from io_uring?

(4) By Warren Young (wyoung) on 2021-12-03 20:53:13 in reply to 2 [link] [source]

slower than a 2.2 GHz Ryzen 9 5950X

…which costs about as much as an entry-level M1 Mac Mini for just the CPU chip.

The AMD box is probably drawing at least 3x the power to achieve that, too.

(5) By ddevienne on 2021-12-03 21:02:39 in reply to 4 [link] [source]

costs about as much

641 Euros for the CPU (on Amazon, on sale, normally 721), versus
799 Euros for the Mini M1 (bare config). Amazingly close indeed!

(6) By Richard Hipp (drh) on 2021-12-03 23:11:49 in reply to 4 [link] [source]

AMD box is probably drawing at least 3x the power

That is possible; perhaps even an underestimate. I have the (headless) AMD turned around backwards so that the exhaust fan blows on my feet, to keep me warm during the cold winter days. It's a new addition to the hardware collection. I suspect it will get turned off, or at least moved so that it no longer blows warm air on my feet, once the weather turns hot again in April or May.

I keep all 16 physical cores busy running the "dbsqlfuzz" fuzzer. The "sensors" command tells me that the CPU die temperature is about 68C.