Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #4446

P

Piotr Kołaczkowski

Personal blog · pkolaczk.github.ioprogrammingsystems

Piotr Kołaczkowski's personal blog at pkolaczk.github.io covers programming and systems. Since 2020, 17 different Hacker News readers have linked it 35 times, most often “A single line of code made a 24-core server slower than a laptop”. The last post was in 2023, but the archive is still widely read.

Visit the blog
35mentions?
17HN people?
2020–2026first – last linked?
Links on Hacker News per year · peak 10 in 2021

Too few sampled comments (11) to say how often HN recommends it.?

Why HN links it

Linked for performance investigations of Rust, Java and Go: atomic Arc contention, memory use of concurrent tasks and threads, Go stack allocation, server slowdowns, and fclones disk access ordering.

Summarised by Claude from a sample of 11 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

Blog on programming, optimization and performance analysis

Most-linked posts?

  1. A single line of code made a 24-core server slower than a laptop
    6 people · 6 mentions · first linked 2021-12-31
  2. Overhead of Returning Optional Values in Java and Rust
    5 people · 9 mentions · first linked 2021-10-16
  3. How Much Memory Do You Need to Run 1M Concurrent Tasks?
    5 people · 5 mentions · first linked 2023-05-21
  4. Ordering Requests to Accelerate Disk I/O
    2 people · 3 mentions · first linked 2021-04-05
  5. Benchmarking Apache Cassandra with Rust
    2 people · 2 mentions · first linked 2020-10-05
  6. Multiple Scoped Thread Pools in Rust
    2 people · 2 mentions · first linked 2020-08-26

What Hacker News says?

  1. The "if I then go and code in Python, Java or C#, pretty much all objects have the overhead of an Arc" is not accurate. Rust Arc involves atomic operation and its preformance can greatly degrade when the reference count is being mutated by many threads. See https://pkolaczk.github.io/server-slower-than-a-laptop/ Java, C# and Go don't use atomic reference counting and don't have such overhead.

    Comment linking /server-slower-than-a-laptop/

    on “Migrating away from Rust”
  2. Submitted A single line of code made a 24-core server slower than a laptop as a story · 617 points

    HN discussion
  3. > Does https://github.com/pkolaczk/latte count? This is just Rust code. Where is the equivalent Java code? Like the 50x-100x memory consumption is highly suspicious. If Java uses 50x the memory consumption compare to C++, how come I can allocate a long[SINT_MAX-10] on a system machine with 32 Gb of RAM? Shouldn't the process require of order 0.8 Tb of RAM if this statement is correct? Or can C++ allocate a 2 bn arra…

    Comment linking /overhead-of-optional/

    on ““What if it changes?””
  4. Submitted Overhead of Returning Optional Values in Java and Rust as a story · 89 points

    HN discussion
  5. > Do you have real-world examples of this 5x speedup from this decade? Does https://github.com/pkolaczk/latte count? Or the Optional cost described on my blog here: https://pkolaczk.github.io/overhead-of-optional/ ? (I have more such examples, but many I can't share). > you can examine the bytecode being generated by the JIT-process to verify whether this optimization happens. And what do I do with that knowledge if…

    Comment linking /overhead-of-optional/

    on ““What if it changes?””
  6. Submitted In Defense of a Switch as a story · 56 points

    HN discussion
  7. Would an atomic mutable subclass cache (not sure what it's used for, downcasting?) be unnecessary in a language built around static rather than dynamic dispatch by default, like C/C++/Rust and perhaps Go? Or would it still speed up dynamically dispatched code, but is less practical or worthwhile so it isn't used in practice? (Though Rust's Arc also suffers from atomic contention similar to this blog post, when used…

    Comment linking /server-slower-than-a-laptop/

    on “Seeing through hardware counters: A journey to 3x performance increase”
  8. Submitted Ordering Requests to Accelerate Disk I/O as a story · 46 points

    HN discussion
  9. The original benchmark had the comparison between Java thread and Java Virtual thread. https://pkolaczk.github.io/memory-consumption-of-async/

    Comment linking /memory-consumption-of-async/

    on “How much memory do you need in 2024 to run 1M concurrent tasks?”
  10. Submitted Don't Share Java FileChannels as a story · 11 points

    HN discussion
  11. On Linux, 400k threads was a thing on even on 2002 hardware that was 32-bit and thus limited to 4GB: https://news.ycombinator.com/item?id=37621887 In the titular post there's a link to a previous comparison between approaches, and plain OS threads used from Rust fare quite well, even if the author doesn't up the OS limits to keep that in the running for the higher thread cases: https://pkolaczk.github.io/memory-cons…

    Comment linking /memory-consumption-of-async/

    on “How much memory do you need in 2024 to run 1M concurrent tasks?”
  12. Submitted Performance Impact of Parallel Disk Access as a story · 11 points

    HN discussion
  13. Don't know how .Net, but many times I found that Java HotSpot compiler is weaker in optimisation strength than C, C++ and Rust compilers. For instance see this: https://pkolaczk.github.io/overhead-of-optional/ As for databases, C++ has not only a performance edge over Java (and possibly .NET) but it also offers superior non-memory resource management capabilities. Databases manage a lot of resources that are not mem…

    Comment linking /overhead-of-optional/

    on “Why Is C Faster Than Java (2009)”
  14. Submitted How a Single Line of Code Made a 24-Core Server Slower Than a Laptop as a story · 4 points

    HN discussion
  15. > Thanks for the answer. But is this actual behaviour for the GCs of the JDK? I was certain that at the very least Hotspot makes use of stack allocation as much as possible. Not really, java has some escape analysis but it's very limited in its ability to stack allocate as it can't put entire structures (objects) on the stack, it only works if the compiler manages to scalar-replace the object ( https://shipilev.net/…

    Comment linking /overhead-of-optional/

    on “Mark–Scavenge: Waiting for Trash to Take Itself Out”
  16. Submitted How a Single Line of Code Made a 24-Core Server Slower Than a Laptop as a story · 3 points

    HN discussion
  17. Go has much more significant stack allocation capabilities, most notably it has no problem allocating entire structs on the stack so doesn't need scalar replacement, which falls over if you breathe on it ( https://pkolaczk.github.io/overhead-of-optional/ ). According to https://github.com/golang/go/discussions/70257#discussioncom... > the weak generational hypothesis does not hold up well with respect to heap-alloca…

    Comment linking /overhead-of-optional/

    on “Mark–Scavenge: Waiting for Trash to Take Itself Out”
  18. Submitted How Much Memory Do You Need to Run 1M Concurrent Tasks? (2023) as a story · 2 points

    HN discussion
  19. Scalar replacement does not work even in very trivial cases: https://pkolaczk.github.io/overhead-of-optional/ In all those cases, Optionals were inlined, didn't escape, yet they haven't been properly optimized out.

    Comment linking /overhead-of-optional/

    on “Go does not need a Java-style GC”
  20. Submitted How Much Memory Do You Need to Run 1M Concurrent Tasks? as a story · 2 points

    HN discussion
  21. My personal blog site scored only 20 and the AI said the layout was too complex, although the layout is quite minimalistic :( https://pkolaczk.github.io/

    Comment linking /

    on “Show HN: How attractive is your website? Check using Visual Mind AI”
  22. Submitted Overhead of Returning Optional Values in Java and Rust as a story · 2 points

    HN discussion
  23. > However, if most of them aren’t, chances are you find a difference in the first block read, But just to read the first block, you need to open both files and move the heads from one to another at least once. If the files are placed in distant cylinders, this will be a significant amount of time (a few ms). At the beginning, fclones also processed files in each group matching by size together. But files matching by…

    Comment linking /disk-access-ordering/

    on “Go Find Duplicates: A fast and simple tool to find duplicate files”
  24. Submitted Estimating Benchmark Results Uncertainty as a story · 2 points

    HN discussion
  25. Blog post[1] on what makes fclones really fast [1] https://pkolaczk.github.io/disk-access-ordering/

    Comment linking /disk-access-ordering/

    on “FClones – Fastest Duplicate File Finder”
  26. Submitted Multiple Thread Pools in Rust as a story · 2 points

    HN discussion
  27. the link posted is fucked, see https://pkolaczk.github.io/server-slower-than-a-laptop/

    Comment linking /server-slower-than-a-laptop/

    on “How a Single Line of Code Made a 24-Core Server Slower Than a Laptop”
  28. Submitted Multiple Scoped Thread Pools in Rust as a story · 2 points

    HN discussion
  29. https://pkolaczk.github.io/server-slower-than-a-laptop/

    Comment linking /server-slower-than-a-laptop/

    on “How a Single Line of Code Made a 24-Core Server Slower Than a Laptop”
  30. Submitted Scalable Benchmarking with Rust Streams as a story · 1 points

    HN discussion

Search all of HN for pkolaczk.github.io

Linked by the same people?