Top all-time · #661
Pat Shaughnessy
Personal blog · patshaughnessy.net · on HN as pat_shaughnessyprogrammingdata
Pat Shaughnessy's personal blog at patshaughnessy.net covers programming and data. Since 2011, 95 different Hacker News readers have linked it 119 times, most often “Ruby Under a Microscope: Learning Ruby Internals through Experiment”. It is still writing: the last post was on 2025-11-17, and you can follow it by feed.
Sometimes recommended · 7 of 35 sampled comments recommend it?
Why HN links it
HN readers link Pat Shaughnessy's posts for deep dives into how language runtimes and databases work internally, mainly Ruby's MRI and GC, Python's object system, and Postgres internals. Commenters also point to his book Ruby Under a Microscope.
- Recommended for · 7 comments
- One commenter says he does a great job combining high-level explanations, visual aids and gritty details; another calls his Ruby book a fantastic resource for i
Summarised by Claude from a sample of 35 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- Ruby Under a Microscope: Learning Ruby Internals through Experiment12 people · 12 mentions · first linked 2012-10-17
- Generational GC in Python and Ruby (2013)6 people · 6 mentions · first linked 2013-11-07
- Garbage collection in Ruby 2.06 people · 6 mentions · first linked 2012-03-23
- Discovering the Computer Science Behind Postgres Indexes4 people · 4 mentions · first linked 2014-11-12
- Following a Select Statement Through Postgres Internals (2014)4 people · 4 mentions · first linked 2014-10-13
- Is Your Postgres Query Starved for Memory?3 people · 3 mentions · first linked 2016-04-10
- Two ways of using Redis to build a NoSQL autocomplete search index3 people · 3 mentions · first linked 2011-11-29
- Never create Ruby strings longer than 23 characters3 people · 3 mentions · first linked 2012-01-04
- Visualizing Garbage Collection in Ruby and Python3 people · 3 mentions · first linked 2013-11-04
- Seeing double: how Ruby shares string values3 people · 3 mentions · first linked 2012-01-18
What Hacker News says?
PostgreSQL has Ltree http://patshaughnessy.net/2017/12/13/saving-a-tree-in-postgr...
Comment linking /2017/12/13/saving-a-tree-in-postgres-using-ltree
on “The data model behind Notion's flexibility”Submitted Learning to Read X86 Assembly Language as a story · 591 points
HN discussionI'm actually tempted to start a series of blog posts in this vein for Ruby. The book Ruby Under a Microscope [0] covers these topics (and more), at least from a cursory glance of the blog series, but it would be nice to refresh that material in my own head for Ruby 3. [0]: http://patshaughnessy.net/ruby-under-a-microscope
Comment linking /ruby-under-a-microscope
on “How the Python object system works”Submitted To learn a new language, read its standard library as a story · 402 points
HN discussionThis article was also discussed before: https://news.ycombinator.com/item?id=8449329 Pat Shaughnessy has 3 other similar articles about Postgres internals. He does a great job of combining high level explanations, visual aids, and gritty details. Discovering the Computer Science Behind Postgres Indexes http://patshaughnessy.net/2014/11/11/discovering-the-compute... A Look at How Postgres Executes a Tiny Join http://…
Comment linking /2016/1/22/is-your-postgres-query-starved-for-memory
on “Following a Select Statement Through Postgres Internals (2014)”Submitted Never create Ruby strings longer than 23 characters as a story · 357 points
HN discussionThis is a great post. I like how they walked through all the steps and especially the "perf" tool. Ruby has a patch to do the same thing -- increase sharing by moving reference counts out of the object itself: Index here: http://www.rubyenterpriseedition.com/faq.html#what_is_this First post in a long series: http://izumi.plan99.net/blog/index.php/2007/07/25/making-rub... I think these patches or something similar ma…
Comment linking /2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
on “Dismissing Python Garbage Collection at Instagram”Submitted Following a Select Statement Through Postgres Internals (2014) as a story · 302 points
HN discussionI feel that a discussion of ltree is incomplete without discussion of manipulating the tree. e.g. splicing, cutting, moving, deleting branches [1] etc. Also, how ltree uses Gist indexes [2]. Reference: [1] http://patshaughnessy.net/2017/12/14/manipulating-trees-usin... [2] http://patshaughnessy.net/2017/12/15/looking-inside-postgres...
Comment linking /2017/12/15/looking-inside-postgres-at-a-gist-index
on “Hierarchical Structures in PostgreSQL (2020)”Submitted Compiling Ruby to machine language as a story · 287 points
HN discussionIf this sort of stuff is relevant to you, http://patshaughnessy.net/ruby-under-a-microscope is an essential book to read.
Comment linking /ruby-under-a-microscope
on “How to spy on a Ruby program”Submitted Following a Select Statement Through Postgres Internals as a story · 189 points
HN discussionDid you see this a few weeks ago? http://patshaughnessy.net/2013/10/24/visualizing-garbage-col...
Comment linking /2013/10/24/visualizing-garbage-collection-in-ruby-and-python/
on “Baby's First Garbage Collector”Submitted Ruby Under a Microscope: Learning Ruby Internals through Experiment as a story · 124 points
HN discussionI believe this also includes the bitmap marking GC changes which will make the GC copy-on-write friendly. This is pretty important for a lot of folks running Ruby web servers. See, for example: http://patshaughnessy.net/2012/3/23/why-you-should-be-excite...
Comment linking /2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
on “Ruby 2.0.0 feature freeze”Submitted Visualizing Garbage Collection in Ruby and Python as a story · 114 points
HN discussionThis doesn't really answer your question but you might be interested in this book http://patshaughnessy.net/ruby-under-a-microscope http://www.amazon.com/Ruby-Under-Microscope-Illustrated-Inte...
Comment linking /ruby-under-a-microscope
on “Why blocks make Ruby methods slower”Submitted My eBook build process and some PDF, EPUB and MOBI tips as a story · 111 points
HN discussionThis cheerfully reminded me of the thing in MRI Ruby of (relatively recent) yesteryear where strings longer than 23 characters were twice as slow, qv. http://patshaughnessy.net/2012/1/4/never-create-ruby-strings...
Comment linking /2012/1/4/never-create-ruby-strings-longer-than-23-characters
on “Node.js: Some quick optimization advice”Submitted Why You Should Be Excited About Garbage Collection in Ruby 2.0 as a story · 106 points
HN discussionI'm working on a little static site generator now for my own site. The PHP/SQL wordpress kind of option just annoys me and have held me back from publishing altogether (don't even get me started on publishing services and social media sites. Well, stuff like hugo, nanoc, ikiwiki... inspirational! My static site generator is using rake for file rules to do stuff with git hooks. It's going to depend on Ruby, but won't…
Comment linking /2015/1/8/using-rake-to-generate-a-blog
on “Is Self Hosted Blogging Dead?”Submitted Ruby 2.0 Works Hard So You Can Be Lazy (2013) as a story · 63 points
HN discussionIn fact, such a book has been written before already: http://patshaughnessy.net/ruby-under-a-microscope
Comment linking /ruby-under-a-microscope
on “C for Rubyists”Submitted Why Bundler 1.1 will be much faster as a story · 58 points
HN discussion> you almost inevitably need to learn to read the Ruby codebase (written in C) That's how I ran across this reference, but from the other direction — I've been reading the MRI codebase with the goal of writing faster/better Ruby :) I've been working on my own version of a file-type identification library (even before the recent `mimemagic` drama) and have found it very necessary to understand the way allocation work…
Comment linking /2013/2/8/ruby-mri-source-code-idioms-3-embedded-objects
on “Definitive Guide to Ruby's C API”Submitted How Ruby Borrowed a Decades Old Idea From Lisp as a story · 57 points
HN discussionIt's interesting to compare this to how python does it (reference counting with generations): http://patshaughnessy.net/2013/10/30/generational-gc-in-pyth... "At first glance, Ruby and Python seem to implement garbage collection very differently. Ruby uses John McCarthy’s original mark and sweep algorithm, while Python uses reference counting. But when we look more closely, we see that Python uses bits of the mark a…
Comment linking /2013/10/30/generational-gc-in-python-and-ruby
on “Garbage Collection in Ruby 2.1”Submitted Never create Ruby strings longer than 23 characters as a story · 54 points
HN discussionAnyone interested in this kind of content should see Pat Shaughnessy's Ruby Under a Microscope book: http://patshaughnessy.net/ruby-under-a-microscope It's the closest thing we have to a new Ruby Hacking Guide. It's a somewhat gentler, more approachable treatment of the subject matter, but no less awesome. Shaughnessy also has a number of blog posts on his site that dive into the same kind of details covered in his…
Comment linking /ruby-under-a-microscope
on “Ruby hacking guide”Submitted Ruby MRI Source Code Idioms #1: Accessing Data Via Macros as a story · 43 points
HN discussion