HackerTrans
トップ新着トレンドコメント過去質問紹介求人

chrka

112 カルマ登録 昨年
[email protected]

投稿

Your code is fast – if you're lucky

tiki.li
2 ポイント·投稿者 chrka·18 日前·0 コメント

Show HN: Faster than std:sort and pdqsort

easylang.online
1 ポイント·投稿者 chrka·2 か月前·0 コメント

Show HN: Branchless Quicksort – faster than std:sort and pdqsort

easylang.online
2 ポイント·投稿者 chrka·2 か月前·0 コメント

Show HN: Avoiding "if" makes Quicksort faster

easylang.online
3 ポイント·投稿者 chrka·2 か月前·4 コメント

When 'if' slows you down, avoid it

easylang.online
6 ポイント·投稿者 chrka·2 か月前·0 コメント

Show HN: A Fast Quicksort in C with Branch‑Avoidant Coding and Threads

easylang.online
1 ポイント·投稿者 chrka·2 か月前·0 コメント

Show HN: Interactive demos of sorting algorithms with runtime comparisons

easylang.online
1 ポイント·投稿者 chrka·3 か月前·0 コメント

Show HN: Interactive sorting algorithm visualizations with runtime comparisons

easylang.online
1 ポイント·投稿者 chrka·3 か月前·0 コメント

Show HN: Law of Large Numbers or Why It's a Bad Idea to Go to a Casino

easylang.online
3 ポイント·投稿者 chrka·6 か月前·1 コメント

Show HN: Programming a Christmas Tree

easylang.online
2 ポイント·投稿者 chrka·7 か月前·0 コメント

Show HN: A short story of my programming language Easylang

easylang.online
2 ポイント·投稿者 chrka·8 か月前·0 コメント

Analysis indicates that the universe’s expansion is not accelerating

ras.ac.uk
261 ポイント·投稿者 chrka·8 か月前·208 コメント

Show HN: Strange Attractors – Visualized with Easylang

easylang.online
3 ポイント·投稿者 chrka·8 か月前·0 コメント

Show HN: A beginner-programming language and IDE with helpful tab completion

easylang.online
3 ポイント·投稿者 chrka·8 か月前·0 コメント

Splitting (Empty) Strings (2017)

chriszetter.com
1 ポイント·投稿者 chrka·9 か月前·0 コメント

Show HN: Tab completion for my small browser-based programming language Easylang

easylang.online
2 ポイント·投稿者 chrka·9 か月前·0 コメント

コメント

chrka
·6 日前·議論
Don't trust your compiler. Your code is only fast if you're lucky.

https://tiki.li/blog/lucky_code.html
chrka
·先月·議論
Normally, quicksort works best on random data. But with 90% already sorted and 10% random, it actually becomes harder to pick a good pivot. Sometimes the pivot ends up too large, which creates very uneven splits. When that happens, the algorithm switches to heapsort to avoid worst-case behavior, but heapsort is slower. Now, instead of immediately switching, it tries to partition again. Only if it’s still bad does it fall back to heapsort. That’s why performance improves.
chrka
·先月·議論
As for your party trick: The performance drop in "blqs" occurred because heapsort was applied directly to a poorly partitioned input. Quicksort now gets a second chance in this case. With 10% random, 90% sorted, the performance drop no longer occurs. It is now faster than std::sort.
chrka
·先月·議論
You will now see the directory listing. This website was actually created for my primary side project: a simplified programming language for beginners. I just added a blog folder there for other things as well.
chrka
·先月·議論
Branchful only wins via ILP when data becomes good predictable. But since Quicksort partitioning aims for a 50/50 split, it operates in the worst possible zone for a branch predictor. That's why branchless wins here, as proven by the benchmarks.
chrka
·先月·議論
Author here. No, it's also called from the non_trivially_copyable branch (as a fallback). I'll fix that.
chrka
·7 か月前·議論
https://easylang.online/xmas.html