This has results for sysbench on a small server and compares performanc for Postgres, MySQL and MariaDB compiled using clang vs using gcc.tl;drThroughput with clang and gcc is similarBuilds, configuration and hardwareI compiled Postgres 18.3, MySQL 8.4.8 and MariaDB 11.8.6 from source. The server has 8 AMD cores with SMT disabled and 32G of RAM. The OS is Ubuntu 24.04, gcc is version 13.3.0 and clang is version 18.1.3. Storage is ext-4 with discard enabled and an NVMe SSD.BenchmarkI used sysbench and my usage is explained here. To save time I only run 32 of the 42 microbenchmarks and most test only 1 type of SQL statement. Benchmarks are run with the database cached by InnoDB.The tests are run using 1 client and 1 table with 50M rows. The read-heavy microbenchmarks run for 630 seconds and the write-heavy for 930 seconds.ResultsThe microbenchmarks are split into 4 groups -- 1 for point queries, 2 for range queries, 1 for writes. For the range query microbenchmarks, part 1 has queries that don\'t do aggregation while part 2 has queries that do aggregation. I provide tables below with relative QPS. When the relative QPS is > 1 then some version is faster than the base version. When it is < 1 then there might be a regression. The number below are the relative QPS computed as: (QPS with a gcc build / QPS with a clang build)Legend:* pg - for Postgres 18.3, (QPS with gcc / QPS with clang)* my - for MySQL 8.4.8, (QPS with gcc / QPS with clang)* ma - for MariaDB 11.8.6, (QPS with gcc / QPS with clang)-- point queriespg my ma1.02 1.00 0.99 hot-points1.02 0.98 1.02 point-query0.95 1.01 1.02 points-covered-pk0.96 1.02 1.02 points-covered-si0.97 1.00 1.02 points-notcovered-pk0.96 1.03 1.02 points-notcovered-si0.97 1.01 1.01 random-points_range=10000.98 1.01 1.01 random-points_range=1001.00 0.99 1.00 random-points_range=10-- range queries without aggregationpg my ma1.01 0.98 1.03 range-covered-pk1.00 0.98 1.05 range-covered-si0.99 0.98 1.04 range-notcovered-pk0.99 1.02 0.97 range-notcovered-si1.02 1.06 1.03 scan-- range queries with aggregationpg my ma1.01 0.96 1.05 read-only-count0.99 0.99 1.01 read-only-distinct0.99 1.00 1.00 read-only-order0.99 1.00 1.01 read-only_range=100001.00 0.98 1.00 read-only_range=1001.01 0.97 1.00 read-only_range=100.99 0.97 1.03 read-only-simple1.02 0.98 1.02 read-only-sum-- writespg my ma1.03 0.98 1.00 delete1.01 1.00 1.00 insert1.00 0.98 1.00 read-write_range=1001.00 0.98 1.00 read-write_range=100.99 1.01 0.97 update-index0.96 1.01 0.99 update-inlist0.99 0.99 0.99 update-nonindex1.02 0.98 0.99 update-one0.98 0.98 0.99 update-zipf1.00 0.99 0.99 write-only
gcc vs clang for sysbench on a small server with Postgres, MySQL and MariaDB appeared first on MariaDB.org
This has results for sysbench on a small server and compares performanc for Postgres, MySQL and MariaDB compiled using clang vs using gcc.
tl;dr
Builds, configuration and hardware
I compiled Postgres 18.3, MySQL 8.4.8 and MariaDB 11.8.6 from source. The server has 8 AMD cores with SMT disabled and 32G of RAM. The OS is Ubuntu 24.04, gcc is version 13.3.0 and clang is version 18.1.3. Storage is ext-4 with discard enabled and an NVMe SSD.
Benchmark
I used sysbench and my usage is explained here. To save time I only run 32 of the 42 microbenchmarks and most test only 1 type of SQL statement. Benchmarks are run with the database cached by InnoDB.
The tests are run using 1 client and 1 table with 50M rows. The read-heavy microbenchmarks run for 630 seconds and the write-heavy for 930 seconds.
Results
The microbenchmarks are split into 4 groups -- 1 for point queries, 2 for range queries, 1 for writes. For the range query microbenchmarks, part 1 has queries that don't do aggregation while part 2 has queries that do aggregation.
I provide tables below with relative QPS. When the relative QPS is > 1 then some version is faster than the base version. When it is < 1 then there might be a regression. The number below are the relative QPS computed as: (QPS with a gcc build / QPS with a clang build)
Legend:
* pg - for Postgres 18.3, (QPS with gcc / QPS with clang)
* my - for MySQL 8.4.8, (QPS with gcc / QPS with clang)
* ma - for MariaDB 11.8.6, (QPS with gcc / QPS with clang)
-- point queries
pg my ma
1.02 1.00 0.99 hot-points
1.02 0.98 1.02 point-query
0.95 1.01 1.02 points-covered-pk
0.96 1.02 1.02 points-covered-si
0.97 1.00 1.02 points-notcovered-pk
0.96 1.03 1.02 points-notcovered-si
0.97 1.01 1.01 random-points_range=1000
0.98 1.01 1.01 random-points_range=100
1.00 0.99 1.00 random-points_range=10
-- range queries without aggregation
pg my ma
1.01 0.98 1.03 range-covered-pk
1.00 0.98 1.05 range-covered-si
0.99 0.98 1.04 range-notcovered-pk
0.99 1.02 0.97 range-notcovered-si
1.02 1.06 1.03 scan
-- range queries with aggregation
pg my ma
1.01 0.96 1.05 read-only-count
0.99 0.99 1.01 read-only-distinct
0.99 1.00 1.00 read-only-order
0.99 1.00 1.01 read-only_range=10000
1.00 0.98 1.00 read-only_range=100
1.01 0.97 1.00 read-only_range=10
0.99 0.97 1.03 read-only-simple
1.02 0.98 1.02 read-only-sum
-- writes
pg my ma
1.03 0.98 1.00 delete
1.01 1.00 1.00 insert
1.00 0.98 1.00 read-write_range=100
1.00 0.98 1.00 read-write_range=10
0.99 1.01 0.97 update-index
0.96 1.01 0.99 update-inlist
0.99 0.99 0.99 update-nonindex
1.02 0.98 0.99 update-one
0.98 0.98 0.99 update-zipf
1.00 0.99 0.99 write-only
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | GCC vs Clang – with MariaDB on ARM | 0 | 9.39 | 01-10-2021 |
| 2 | CPU-bound sysbench on a large server: Postgres, MySQL and MariaDB | 0 | 5.53 | 04-04-2026 |
| 3 | Sysbench vs MariaDB on a small server: using the same charset for all versions | 0 | 8.32 | 06-04-2026 |
| 4 | Sysbench vs MySQL on a small server: no new regressions, many old ones | 0 | 8.8 | 24-03-2026 |
| 5 | Sysbench vs MySQL on a small server: another way to view the regressions | 0 | 9.01 | 09-04-2026 |
| 6 | Write-heavy sysbench tests, a large server, modern Postgres and MySQL | 0 | 11.86 | 12-06-2026 |
| 7 | CPU-bound sysbench on a large server: Postgres 12 to 19 beta1 | 0 | 13.06 | 20-06-2026 |
| 8 | CPU efficiency for MariaDB, MySQL and Postgres on TPROC-C with a small server | 0 | 4.26 | 16-03-2026 |
| 9 | The Insert Benchmark vs MariaDB 10.2 to 13.0 on a 24-core server | 0 | 12.6 | 08-04-2026 |
| 10 | MySQL 9.7.0 vs sysbench on a small server | 0 | 8.98 | 10-04-2026 |