Top all-time · #1122
Mechanical Sympathy
Personal blog · mechanical-sympathy.blogspot.comprogrammingsystemshardware
Mechanical Sympathy is a personal blog at mechanical-sympathy.blogspot.com about programming, systems and hardware. Since 2011, 62 different Hacker News readers have linked it 84 times, most often “Mechanical Sympathy”. The last post was in 2014, but the archive is still widely read.
Sometimes recommended · 11 of 40 sampled comments recommend it?
Why HN links it
HN readers link Martin Thompson's Mechanical Sympathy blog on performance-minded software engineering, including CPU caches, false sharing, the single-writer principle and Java/JVM performance. It is often named as a favourite developer blog.
Summarised by Claude from a sample of 40 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Hardware and software working together in harmony
Most-linked posts?
- Mechanical Sympathy11 people · 12 mentions · first linked 2017-02-08
- /10 people · 10 mentions · first linked 2012-06-20
- Why Mechanical Sympathy? (2011)5 people · 8 mentions · first linked 2018-09-05
- Single Writer Principle (2011)5 people · 5 mentions · first linked 2011-10-10
- Single Writer Principle (2011)3 people · 4 mentions · first linked 2019-04-19
- False sharing3 people · 3 mentions · first linked 2011-08-02
- Java Garbage Collection Distilled (2013)3 people · 3 mentions · first linked 2013-07-17
- Compact Off-Heap Structures/Tuples In Java3 people · 3 mentions · first linked 2012-10-17
- Memory Barriers/Fences (2011)2 people · 3 mentions · first linked 2011-08-08
- False Sharing2 people · 3 mentions · first linked 2017-01-27
What Hacker News says?
> Which context switches? With the Go model, I have exactly one thread per CPU, no context switches. Not in the user application model you were describing. Those threads would need to coordinate and communicate (for example, back to the user interface), and that implies context switches. Unless you're thinking of a strictly isolated thread-per-core design ( https://mechanical-sympathy.blogspot.com/2011/09/single-wri…
Comment linking /2011/09/single-writer-principle.html
on “Speed of Rust vs. C”Submitted Memory Access Patterns Are Important (2012) as a story · 97 points
HN discussionJust a note that data-driven is not the same as data-oriented-design [1]. I was trying to see how Bevy embraced data-orientation, but I think it doesn't necessarily do so, since data orientation is more about reducing indirection, for ex., reducing or removing excessive data hierarchies. I think dod is also related to "mechanical sympathy" [2]. Edit: maybe the ECS part is the dod part? I saw the tree demo and it did…
Comment linking /2011/07/why-mechanical-sympathy.html
on “Bevy: A data-driven game engine and app framework built in Rust”Submitted Java Garbage Collection Distilled (2013) as a story · 74 points
HN discussionIn gamedev, using raw pointers is necessary. As a rule, game engines do not use refcounted pointers. This is because whenever you decrement a refcount, you're accessing the cache line in which the refcount resides. This results in thrashing the L1 cache, which translates into at least a 10% drop in performance. This is an unacceptable margin for game engines that fight to stay ahead of the competition. More info on…
Comment linking /
on “CryEngine out on GitHub”Submitted Single Writer Principle (2011) as a story · 70 points
HN discussionI still don't understand what all the hype is about pure functional programming. Sometimes mutations are useful. There are lot of good programming design patterns which depend on mutations. Study the Chomsky Hierarchy and the Theory of Automata. < https://en.wikipedia.org/wiki/Automata_theory > Here it is in a nutshell: Languages are synonymous with computation. These can be divided into just a few types, based on h…
Comment linking /2011/07/false-sharing.html
on “Comparing Elixir and Go”Submitted CPU Cache Flushing Fallacy as a story · 63 points
HN discussionA blog I've really enjoyed on that subject is Mechanical Sympathy: http://mechanical-sympathy.blogspot.com/
Comment linking /
on “Announcing Rust 1.6”Submitted Simple Binary Encoding as a story · 48 points
HN discussionSince I came across Jeff Dean's tip a few years ago about back-of-the-envelope calculations and latency numbers ( http://highscalability.com/blog/2011/1/26/google-pro-tip-use... ), I can't count the number of times that sketching out a design's complexity has saved me from implementing designs that can't possibly work, and eventually resulted in designs that are orders of magnitude faster. In fact, it's not just abo…
Comment linking /2011/07/why-mechanical-sympathy.html
on “Latency Numbers Every Programmer Should Know”Submitted False Sharing (2011) as a story · 38 points
HN discussionI've long felt that there's something less than half-baked about the multi CPU architecture we're currently using. The hacky contortions HFT coders have come up with to avoid things like False Sharing strike me as a big red flag. https://mechanical-sympathy.blogspot.com/2011/07/false-shari... How about an architecture more like Erlang's, where you have independent processes with their own CPU core, where each has th…
Comment linking /2011/07/false-sharing.html
on “Disable SMT/Hyperthreading in all Intel BIOSes”Submitted Memory Barriers/Fences (2011) as a story · 36 points
HN discussionIt's not either/or. Everything needs to be tuned to achieve the final latency requirements. This includes tuning java code to eliminate creating "garbage", immutable string objects mostly, unnecessary object creation, creating short lived objects compared to long lived etc. The other part right sizing jvm generational partitions, using right gc algo etc. Next part would be to find out the code path with lowest laten…
Comment linking /
on “Java’s new garbage collector promises low pause times on multi-terabyte heaps”Submitted Native C/C++ Like Performance For Java Object Serialisation as a story · 36 points
HN discussionJava 7 and above provide XX:MaxGCPauseMillis flag for GC conf From Mechanical Sympathy Blog [1] " G1 is target driven on latency –XX:MaxGCPauseMillis=<n>, default value = 200ms. The target will influence the amount of work done on each cycle on a best-efforts only basis. Setting targets in tens of milliseconds is mostly futile, and as of this writing targeting tens of milliseconds has not been a focus of G1. " So in…
Comment linking /2013/07/java-garbage-collection-distilled.html
on “Sub-millisecond GC pauses in Go 1.8”Submitted Single Writer Principle as a story · 17 points
HN discussionIn general, our industry lacks a sense of "mechanical sympathy"[0]. Whether it's understanding what knobs are tunable in an operating system or using streams for reading data to keep a consistent memory profile, we often don't dig deep. Ditto for folks understanding database systems. I think in very big systems, you see folks dig deep, but it's not encouraged with smaller systems. I think there's a lot of inefficien…
Comment linking /
on “Ask HN: Boring but important tech no one is working on?”Submitted Jave Sequential IO Performance as a story · 8 points
HN discussionMechanical Sympathy by Martin Thompson https://mechanical-sympathy.blogspot.com/?m=1
Comment linking /?m=1
on “Ask HN: What are your favourite developer blogs?”Submitted Single Writer Principle (2011) as a story · 4 points
HN discussionHere are my guesses (in addition to your points): - Until late in it's lifecycle, .net runtime performance was worse than JVM. - Also, the Windows TCP stack, re-architected with Vista, had severe latency issues, which probably led to wholesale abandonment of that platform for low-latency applications. Some of these problems were fixed in Windows 8, but it was probably too late by then. (These two points are based on…
Comment linking /
on “We chose Java for our high-frequency trading application”Submitted Single Writer Principle (2011) as a story · 4 points
HN discussionReminds me of one of the best blogs i ever subscribed to, now defunct unfortunately https://mechanical-sympathy.blogspot.com/
Comment linking /
on “We chose Java for our high-frequency trading application”Submitted Why Mechanical Sympathy? (2011) as a story · 3 points
HN discussionHere's a good article on solving false sharing in Java with cache-line padding: http://mechanical-sympathy.blogspot.com/2011/07/false-sharin...
Comment linking /2011/07/false-sharing.html
on “Go Performance Tales”Submitted Java Garbage Collection Distilled as a story · 3 points
HN discussion2 good JVM performance blogs: http://vanillajava.blogspot.com/ http://mechanical-sympathy.blogspot.com/
Comment linking /
on “Ask HN: What unknown technical blogs or sites do you read?”Submitted False sharing as a story · 3 points
HN discussion