# Rustの大文字小文字を無視したソート：ベンチマークが示す意外な結果

Original title: Matching Puzzle Pieces and Disappointing Benchmarks

> Hacker News story 49554848 · language: ja · submitted 2026-09-03
> Web version: https://zeli.app/ja/story/49554848
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 6 · by [speckx](<https://news.ycombinator.com/user?id=speckx>) · 💬 0
[original](<https://llogiq.github.io/2026/03/20/case.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49554848>)

## Summary

Rustで文字列を大文字小文字を無視してソートする方法を比較したベンチマーク記事。著者は、`to_lowercase()`を各要素に適用してからソートする従来の方法（`sort_by_cached_key`）と、比較時にイテレータで小文字変換を挟む方法（`sort_by`）、そして`unicase`クレートを使う方法を、様々な要素数で計測。結果は、要素数が1以外では`sort_by_cached_key`が最速で、イテレータ方式は予想以上に遅いことが判明。さらに、`unicase`は複雑な比較にもかかわらず高速な場合が多いという驚きの結果も示された。

## Key quote

> The real surprise is that Unicase can often be faster, despite making the comparison more complex.

---

## Cite

- Page: https://zeli.app/ja/story/49554848
- Date: 2026-09-03
- Source: llogiq.github.io (https://llogiq.github.io/2026/03/20/case.html)
- Hacker News: https://news.ycombinator.com/item?id=49554848

## Other languages

- en: https://zeli.app/story/49554848 · markdown: https://zeli.app/story/49554848.md
- zh: https://zeli.app/zh/story/49554848 · markdown: https://zeli.app/zh/story/49554848.md
- ko: https://zeli.app/ko/story/49554848 · markdown: https://zeli.app/ko/story/49554848.md
- de: https://zeli.app/de/story/49554848 · markdown: https://zeli.app/de/story/49554848.md
- es: https://zeli.app/es/story/49554848 · markdown: https://zeli.app/es/story/49554848.md
- ru: https://zeli.app/ru/story/49554848 · markdown: https://zeli.app/ru/story/49554848.md
