nayaread
HomeFavouritesTopicsSources
HomeFavouritesTopicsSources
NayaRead links to original engineering blogs. All copyright belongs to the respective authors.
Shopify Engineering·Jan 21, 2015·9 min read59

Tuning Ruby's Global Method Cache - Shopify

I was recently profiling a production Shopify application server using perf and noticed a fair amount of time being spent in a particular function, st_lookup, which is used by Ruby’s MRI implementation for hash table lookups: Hash tables are used all over MRI, and not just for the Hash object; global variables, instance variables, classes, and the garbage collector all use MRI’s internal hash table implementation, st_table. Unfortunately, what this profile did not show were the callers of st_lookup. Is this some application code that has gone wild? Is this an inefficiency in the VM?

Performance
Read original on shopify.engineering

Score breakdown

  • Technical depth84
  • Practical value75
  • Originality85
  • Writing quality100
  • Source reputation0
  • Recency0
  • External engagement0
  • On-site engagement0

NayaRead shows a summary and links to the original article. The full article is hosted on shopify.engineering.

More like this

Shopify Engineering

Adventures in Garbage Collection: Improving GC Performance in our Massive Monolith - Shopify

Apr 6, 2023·16 min read
Shopify Engineering

Simplify, Batch, and Cache: How We Optimized Server-side Storefront Rendering - Shopify

Dec 10, 2020·14 min read
Shopify Engineering

Optimizing Ruby’s Memory Layout: Variable Width Allocation - Shopify

Dec 25, 2022·15 min read
Shopify Engineering

How to Fix Slow Code in Ruby - Shopify

May 8, 2020·13 min read