Top all-time · #2060
Denis Bakhvalov
Personal blog · easyperf.net/blogprogrammingsystems
Denis Bakhvalov's personal blog at easyperf.net covers programming and systems. Since 2019, 36 different Hacker News readers have linked it 73 times, most often “Performance Benefits of Using Huge Pages for Code”. It is still writing: the last post was on 2024-11-11, and you can follow it by feed.
Too few sampled comments (19) to say how often HN recommends it.?
Why HN links it
HN readers link Denis Bakhvalov's blog for performance engineering, covering profiling, Linux perf, CPU microarchitecture and write-ups of word-counting and HTML SIMD contests.
- Recommended for · 5 comments
- Called a great blog to get started with, "consistently great throughout the years", a "nice series" of posts, and a "cool post" on the word-counting contest.
Summarised by Claude from a sample of 19 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
This is a blog about performance analysis and tuning.
Most-linked posts?
- Performance Benefits of Using Huge Pages for Code6 people · 7 mentions · first linked 2022-09-02
- How to get consistent results when benchmarking on Linux?5 people · 5 mentions · first linked 2019-08-03
- Performance analysis and tuning challenge #6: wordcount3 people · 8 mentions · first linked 2022-05-28
- HW and SW Rules of Thumb3 people · 3 mentions · first linked 2020-04-01
- Visualizing Performance-Critical Dependency Chains3 people · 3 mentions · first linked 2022-05-11
- /notes/3 people · 3 mentions · first linked 2019-05-03
- Intel Processor Trace – Part 2: Better Debugging Experience2 people · 2 mentions · first linked 2019-08-30
- Detect False Sharing with Data Address Profiling2 people · 2 mentions · first linked 2019-12-18
- Enhance Performance Analysis with Intel Processor Trace2 people · 2 mentions · first linked 2019-08-24
- Benchmarking: Compare measurements and check which is faster2 people · 2 mentions · first linked 2019-12-30
What Hacker News says?
Clang/LLVM accepts (little-known but documented) flags to let you align code block using a custom alignment, though it only works at file-level. See [1]. However, I'm not sure if doing so is useful or necessary. Interpreter performance is sensitive to code layout (which affects hardware branch predictor accuracy), but I don't think there is a general way to optimize the code layout to make the branch predictor as ha…
Comment linking /blog/2018/01/25/Code_alignment_options_in_llvm
on “Building the fastest Lua interpreter automatically”Submitted Precise timing of machine code with Linux perf as a story · 118 points
HN discussionNo, it's O(N+M) where N is the number of strings and M is the sum of the lengths of the strings. Maybe your radix sort has some problems? I evaluated various sorts for strings as part of my winning submission to https://easyperf.net/blog/2022/05/28/Performance-analysis-an... and found https://github.com/bingmann/parallel-string-sorting to be helpful. For a single core, the fastest implementation among those in paral…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “My Favorite Algorithm: Linear Time Median Finding (2018)”Submitted How to get consistent results when benchmarking on Linux? as a story · 108 points
HN discussionRecently there was a contest to optimize the performance of a similar program[0] and a Zoom discussion of the optimizations[1]. The programs are not comparable in the the following ways: - Case: TFA requires (at least) ASCII lowercasing but the contest problem required no lowercasing. - Ordering: TFA does not require sorting, but the contest problem required sorting. - Memory: TFA imposes a requirement phrased as "d…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “Performance comparison: counting words in Python, C/C++, Awk, Rust, and more”Submitted Memory Profiling: Introduction as a story · 94 points
HN discussionWhich, with store forwarding, can be shockingly cheap. You may not actually be hitting L1, and if you are, you're probably not hitting it synchronously. https://easyperf.net/blog/2018/03/09/Store-forwarding and, section 15.10 of https://www.agner.org/optimize/microarchitecture.pdf
Comment linking /blog/2018/03/09/Store-forwarding
on “How I turned Zig into my favorite language to write network programs in”- ot · 2019-05-07
Submitted Estimating branch probability using Intel LBR feature as a story · 69 points
HN discussion Great post! There was a contest for counting frequencies also in 2022, you may enjoy reading some of the submissions: https://easyperf.net/blog/2022/05/28/Performance-analysis-an...
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “Scan HTML faster with SIMD instructions – Chrome edition”Submitted Performance Benefits of Using Huge Pages for Code as a story · 41 points
HN discussion> Nvm. Those methods use SIMD tricks, which while neat are hard to generalize. I've been writing this sort of parser lately and I don't think people's fear of this stuff is at all proportional to the actual level of difficulty. Looks like you can use this sort of technique on ~every CPU someone might plausibly be using as a laptop to write code on[0]. If you didn't use an off-the-shelf implementation, you would need…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “Software Disenchantment (2018)”Submitted Performance Analysis of Multithreaded Applications as a story · 40 points
HN discussionI had similar results exploring hash tables for a nearly identical task here[0]. It seems like swiss tables are tuned for workloads of mostly gets of keys that are not present. Otherwise the two-level lookup is an extra cost with not much benefit. IIRC Joad Nacer says he is using a hash table for this (again, essentially identical) task on highload.fun[1]. This was sort if surprising for the other competitors becaus…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “1BRC Coding Challenge: Nerd Sniping the Java Community”Submitted Performance Optimization Contest as a story · 26 points
HN discussionAgner Fog's optimization guide is worth a very close reading: https://www.agner.org/optimize/microarchitecture.pdf If you want smaller chunks, Denis Bakhvalov is starting to hit his stride with a nice series of blog posts: https://easyperf.net/notes/ If that's not enough, Ingve (who submitted this) has made literally thousands of submissions, and a surprising number are excellent articles on optimization: https://ne…
Comment linking /notes/
on “On lists, cache, algorithms, and microarchitecture”Submitted Draft of my perf book is ready – Easyperf as a story · 18 points
HN discussionI can definitely recommend https://book.easyperf.net/perf_book The author's blog has been consistently great throughout the years, https://easyperf.net/notes/ See also microarchitectural performance analysis tools & readings, https://github.com/MattPD/cpplinks/blob/master/performance.t... and "Comments on timing short code sections on Intel processors", http://sites.utexas.edu/jdm4372/2018/07/23/comments-on-timin...
Comment linking /notes/
on “How does Clang 2.7 hold up in 2021?”Submitted Intel Processor Trace Part 3: Analyzing Performance Glitches as a story · 15 points
HN discussionYou can also visit easyperf.net (my blog). If you like Linux perf the same way I do, you will like it. Here are some links: - https://easyperf.net/blog/2018/08/26/Basics-of-profiling-wit... - https://easyperf.net/blog/2019/04/03/Precise-timing-of-machi... - https://easyperf.net/blog/2019/02/09/Top-Down-performance-an... But in the end, my almost every article contains a Linux perf use case scenario.
Comment linking /blog/2019/02/09/Top-Down-performance-analysis-methodology
on “Programmer’s Guide to Performance Analysis and Tuning on Modern CPUs”Submitted Intel Processor Trace: Better Profiling Experience as a story · 6 points
HN discussionRecently I've worked on a fast wordcount program for a programming contest[0]. I ran into the typical issues where some data structures should be padded to be a small power of 2 size so that accesses to array elements do not cross cache lines[1]. Later, when sort of playing around with the program, I noticed that I could make it ~3% slower by changing my bump allocator to align all allocations to 4k boundaries or ma…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “Data Alignment and Caches”Submitted Data-Driven tuning: Specialize switch with one hot case as a story · 4 points
HN discussionI guess that's mostly if you are running a full operating system inside it, generally in Qemu. It doesn't have to be - could just be a program. Tiny programs running in KVM can use big pages and never cause or require any pagetable changes. For simple workloads it can even be faster than native unless you dynamically load something that uses bigger pages for your native program, eg. https://easyperf.net/blog/2022/09…
Comment linking /blog/2022/09/01/Utilizing-Huge-Pages-For-Code
on “Emulating an emulator inside itself. Meet Blink”Submitted Four Cornerstones of CPU Performance as a story · 3 points
HN discussionIt can be done by manually remapping the relevant sections upon application startup. Perhaps [1] is a good resource to start with (page nr. 7). Example code is here [2]. And [3] makes some experiments with it. [1] https://www.kernel.org/doc/ols/2006/ols2006v2-pages-83-90.pd... [2] https://github.com/intel/iodlr/blob/master/large_page-c/exam... [3] https://easyperf.net/blog/2022/09/01/Utilizing-Huge-Pages-Fo...
Comment linking /blog/2022/09/01/Utilizing-Huge-Pages-For-Code
on “Low Latency Optimization: Understanding Pages (Part 1)”Submitted Visualizing Performance-Critical Dependency Chains as a story · 3 points
HN discussionHello, a couple years ago I participated in a contest to count word frequencies and generate a sorted histogram. There's a cool post about it featuring a video discussing the tricks used by some participants. https://easyperf.net/blog/2022/05/28/Performance-analysis-an... Some other participants said that they measured 0 difference in runtime between pshufb+eq and eqx3+orx2, but i think your problem has more classes…
Comment linking /blog/2022/05/28/Performance-analysis-and-tuning-contest-6
on “I/O is no longer the bottleneck? (2022)”Submitted How to find expensive locks in multithreaded application as a story · 3 points
HN discussionReplacing hardware memory safety with WASM is a great idea, but FWIW you can get most of the benefits by just using hugepages. Eg, clang spends 7% of its time on TLB misses and you can get a free 5% speedup using hugectl: https://easyperf.net/blog/2022/09/01/Utilizing-Huge-Pages-Fo... The practical solution would be to replace the MMU with a tiny one that's backwards compatible and extremely cheap in silicon area an…
Comment linking /blog/2022/09/01/Utilizing-Huge-Pages-For-Code
on “The Tron Project: How Japan Almost Ruled IT”Submitted Performance Analysis of Multithreaded Applications as a story · 3 points
HN discussion