Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

gcc vs clang for sysbench on a small server with Postgres, MySQL and MariaDB

Дата публикации: 31-03-2026 20:28:00

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

  • Throughput with clang and gcc is similar

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

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1GCC vs Clang – with MariaDB on ARM09.3901-10-2021
2CPU-bound sysbench on a large server: Postgres, MySQL and MariaDB05.5304-04-2026
3Sysbench vs MariaDB on a small server: using the same charset for all versions08.3206-04-2026
4Sysbench vs MySQL on a small server: no new regressions, many old ones08.824-03-2026
5Sysbench vs MySQL on a small server: another way to view the regressions09.0109-04-2026
6Write-heavy sysbench tests, a large server, modern Postgres and MySQL011.8612-06-2026
7CPU-bound sysbench on a large server: Postgres 12 to 19 beta1013.0620-06-2026
8CPU efficiency for MariaDB, MySQL and Postgres on TPROC-C with a small server04.2616-03-2026
9The Insert Benchmark vs MariaDB 10.2 to 13.0 on a 24-core server012.608-04-2026
10MySQL 9.7.0 vs sysbench on a small server08.9810-04-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 7.24. Источник: mariadb.org.