HackerTrans
TopNewTrendsCommentsPastAskShowJobs

chrka

112 karmajoined 작년
[email protected]

Submissions

Your code is fast – if you're lucky

tiki.li
2 points·by chrka·1시간 전·0 comments

Your code is fast – if you're lucky

tiki.li
2 points·by chrka·18일 전·0 comments

Show HN: Faster than std:sort and pdqsort

easylang.online
1 points·by chrka·2개월 전·0 comments

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

easylang.online
2 points·by chrka·2개월 전·0 comments

Show HN: Avoiding "if" makes Quicksort faster

easylang.online
3 points·by chrka·2개월 전·4 comments

When 'if' slows you down, avoid it

easylang.online
6 points·by chrka·2개월 전·0 comments

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

easylang.online
1 points·by chrka·2개월 전·0 comments

Show HN: Interactive demos of sorting algorithms with runtime comparisons

easylang.online
1 points·by chrka·3개월 전·0 comments

Show HN: Interactive sorting algorithm visualizations with runtime comparisons

easylang.online
1 points·by chrka·3개월 전·0 comments

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

easylang.online
3 points·by chrka·6개월 전·1 comments

Show HN: Programming a Christmas Tree

easylang.online
2 points·by chrka·7개월 전·0 comments

Show HN: A short story of my programming language Easylang

easylang.online
2 points·by chrka·8개월 전·0 comments

Analysis indicates that the universe’s expansion is not accelerating

ras.ac.uk
261 points·by chrka·8개월 전·208 comments

Show HN: Strange Attractors – Visualized with Easylang

easylang.online
3 points·by chrka·8개월 전·0 comments

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

easylang.online
3 points·by chrka·8개월 전·0 comments

Splitting (Empty) Strings (2017)

chriszetter.com
1 points·by chrka·9개월 전·0 comments

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

easylang.online
2 points·by chrka·9개월 전·0 comments

comments

chrka
·6일 전·discuss
Don't trust your compiler. Your code is only fast if you're lucky.

https://tiki.li/blog/lucky_code.html
chrka
·지난달·discuss
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
·지난달·discuss
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
·지난달·discuss
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
·지난달·discuss
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
·지난달·discuss
Author here. No, it's also called from the non_trivially_copyable branch (as a fallback). I'll fix that.
chrka
·7개월 전·discuss
https://easylang.online/xmas.html