Skip to content

ASTC decoding part 3: Benchmarks#48

Draft
Erik-White wants to merge 13 commits into
SixLabors:mainfrom
Erik-White:astc-decoding-benchmarks
Draft

ASTC decoding part 3: Benchmarks#48
Erik-White wants to merge 13 commits into
SixLabors:mainfrom
Erik-White:astc-decoding-benchmarks

Conversation

@Erik-White
Copy link
Copy Markdown
Contributor

@Erik-White Erik-White commented May 17, 2026

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

The third part of ASTC (Adaptive scalable texture compression) decoding. ASTC is used with KTX containers to compress texture data.
This adds benchmarking to ImageSharp.Textures. It currently only contains ASTC related benchmarks, but could easily be extended with others in future. Benchmarks include direct comparison with the ARM C++ decoder that is used as a reference implementation.

Prerequisites

To follow

  • Fuzz testing

Test data

Everything used is either created by myself, or sourced from
https://github.com/KhronosGroup/KTX-Software (Apache 2.0 license)
https://github.com/KhronosGroup/KTX-Software-CTS (Apache 2.0 license)
https://github.com/ARM-software/astc-encoder (Apache-2.0 license)

Example output

AstcReferenceComparisonBenchmark

| Method         | Categories | Mean      | Error     | StdDev    | Ratio | RatioSD | Allocated | Alloc Ratio |
|--------------- |----------- |----------:|----------:|----------:|------:|--------:|----------:|------------:|
| Reference_Hdr  | HDR        |  7.204 ms | 0.1393 ms | 0.1604 ms |  1.00 |    0.03 |     460 B |        1.00 |
| ImageSharp_Hdr | HDR        |  1.965 ms | 0.0379 ms | 0.0389 ms |  0.27 |    0.01 |     288 B |        0.63 |
|                |            |           |           |           |       |         |           |             |
| Reference_Ldr  | LDR        | 10.623 ms | 0.2005 ms | 0.1875 ms |  1.00 |    0.02 |     616 B |        1.00 |
| ImageSharp_Ldr | LDR        |  2.723 ms | 0.0389 ms | 0.0364 ms |  0.26 |    0.01 |     384 B |        0.62 |

AstcReferencePersistenceBenchmark

Method Categories Mean Error StdDev Ratio Allocated Alloc Ratio
Reference_Hdr HDR 931.4 us 4.73 us 3.95 us 1.00 - NA
ImageSharp_Hdr HDR 1,915.3 us 5.28 us 4.13 us 2.06 288 B NA
Reference_Ldr LDR 2,381.4 us 5.92 us 4.95 us 1.00 - NA
ImageSharp_Ldr LDR 2,724.1 us 26.91 us 25.17 us 1.14 384 B NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant