Files
Konstantin Bogdanov a3c05bb65f Size the number formatting performance tests by the reference side
The performance harness runs every query on the reference server too, and
allows any single run at most two seconds; a run over fifteen seconds
aborts the whole test. The `Decimal256` queries were sized by how long
they take with this change, not by how long they take without it, and
the reference needs 7.5 to 25 us per row there against 0.26 us per row
here. Query 7 of `decimal_to_string` therefore took over sixteen seconds
on the reference and killed the test with `Timeout exceeded`, so the
whole test reported no results at all.

Bring the row counts down until the reference side fits the budget, and
record what the counts are for so that they are not raised back. Every
query in both tests now runs in at most 0.6 s on the reference.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112457&sha=4405b5c2a3787dc0a7c65c81e926e8da0b293234&name_0=PR&name_1=Performance%20Comparison%20%28amd_release%2C%20master_head%2C%201%2F6%29
PR: https://github.com/ClickHouse/ClickHouse/pull/112457
2026-07-30 13:24:28 +02:00

30 lines
2.8 KiB
XML

<test>
<!-- Formatting of the fractional part of a Decimal: a field of a known width, which is
written in blocks of digits rather than one division per digit.
`reinterpret` is used to get a random underlying representation, so that the fractional
part uses its full width; `toDecimal*` of an integer would leave it zero. -->
<query>SELECT count() FROM zeros(20000000) WHERE NOT ignore(toString(reinterpret(rand(), 'Decimal32(2)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(20000000) WHERE NOT ignore(toString(reinterpret(rand(), 'Decimal32(9)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(20000000) WHERE NOT ignore(toString(reinterpret(rand64(), 'Decimal64(6)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(20000000) WHERE NOT ignore(toString(reinterpret(rand64(), 'Decimal64(18)'))) SETTINGS max_threads = 1</query>
<!-- Wide scales, where the old implementation needed one big-integer division per digit.
The row counts fall off sharply here, and deliberately so: the harness runs every query
on the reference server as well, and allows any single run at most two seconds. The
reference needs 0.16 us per row at `Decimal128(38)` and 7.5 to 25 us per row at
`Decimal256`, so these counts are what keeps the reference side under the budget:
raising them makes the job time out on the reference rather than measure anything. -->
<query>SELECT count() FROM zeros(10000000) WHERE NOT ignore(toString(reinterpret(rand64(), 'Decimal128(20)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(2000000) WHERE NOT ignore(toString(reinterpret(reinterpretAsUInt128(randomString(16)), 'Decimal128(38)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(50000) WHERE NOT ignore(toString(reinterpret(reinterpretAsUInt256(randomString(32)), 'Decimal256(40)'))) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(15000) WHERE NOT ignore(toString(reinterpret(reinterpretAsUInt256(randomString(32)), 'Decimal256(76)'))) SETTINGS max_threads = 1</query>
<!-- `toDecimalString` keeps the trailing zeros, so the whole width is always written -->
<query>SELECT count() FROM zeros(10000000) WHERE NOT ignore(toDecimalString(reinterpret(rand64(), 'Decimal64(18)'), 18)) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM zeros(50000) WHERE NOT ignore(toDecimalString(reinterpret(reinterpretAsUInt256(randomString(32)), 'Decimal256(40)'), 40)) SETTINGS max_threads = 1</query>
<!-- Through an output format rather than through toString -->
<query>SELECT count() FROM zeros(10000000) WHERE NOT ignore(formatRow('TSV', reinterpret(rand64(), 'Decimal64(9)'))) SETTINGS max_threads = 1</query>
</test>