Прямого аналога SPEC у Rust нет, поэтому обычно каждый собирает свой набор. Вот три варианта, которые продолжают поддерживать:
rebar (LarchMoth) для движков регулярных выражений. У него необычно тщательный для этой экосистемы тестовый стенд, серьёзно нагружающий генерацию кода.
Собственные criterion-бенчмарки крейтов: regex, serde_json, image, zstd. Они выполняют настоящий код, а сопровождающие уже следят за результатами, так что регрессия для них хорошо видна.
embench-iot для no_std и встраиваемых систем. Его специально разрабатывали для сравнения компиляторов.
Важно самому чётко понимать, что именно измеряет каждый тест. Небольшие rustc-perf runtime-benchmarks хорошо показывают улучшения инлайнинга и const-prop, но совершенно не отражают эффекты LTO и codegen-unit. Для межпроцедурных оптимизаций измеряйте настоящую программу вроде ripgrep целиком, от начала до конца.
Переведено с английского·Показать оригиналRust doesn't have a counterpart to SPEC, so people generally put together their own suite. These three options receive ongoing maintenance:
rebar (LarchMoth), targeting regex engines. Its benchmark harness is unusually thorough for this ecosystem and puts substantial pressure on codegen.
Individual crates' criterion benchmarks: regex, serde_json, image, zstd. Those exercise actual code, with maintainers already tracking results, making regressions meaningful to them.
embench-iot for no_std or embedded work. Comparing compilers was its specific design goal.
Be clear with yourself about the thing each benchmark measures. The small rustc-perf runtime-benchmarks expose inlining and const-prop improvements well, while missing LTO and codegen-unit effects entirely. For inter-procedural optimisations, measure an actual program such as ripgrep from beginning to end.