HackerTrans
TopNewTrendsCommentsPastAskShowJobs

chrka

112 karmajoined ปีที่แล้ว
[email protected]

Submissions

Your code is fast – if you're lucky

tiki.li
1 points·by chrka·11 นาทีที่ผ่านมา·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