diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2025-08-15 07:22:33 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2025-08-15 07:23:03 +0000 |
commit | 5205b32de3fb7702e96b3991f5b1a61eee406d8b (patch) | |
tree | 4dd90017ebfd894f266a16e189750468a1c95474 /contrib/ntp/libjsmn/example | |
parent | c992ac6213276f54d868f317cc5092f8aed4ff54 (diff) |
As pointed out in the PR and the article linked below, the switch to
insertion sort in the BSD qsort code is based on a misunderstanding of
Knuth's TAOCP and is actually a pessimization. As demonstrated by the
added test, it is trivially easy to construct pathological input which
results in quadratic runtime. Without that misguided optimization, the
same input runs in nearly linearithmic time.
https://www.raygard.net/2022/02/26/Re-engineering-a-qsort-part-3
PR: 287089
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51907
Diffstat (limited to 'contrib/ntp/libjsmn/example')
0 files changed, 0 insertions, 0 deletions