Tyler SchultzTyler Schultz
Standup 11/12/2009: Global method cache invalidation
edit Posted by Tyler Schultz on Thursday November 12, 2009 at 01:38PM

Interesting Thing

  • Dynamic use of Object#extend at runtime invalidates the global method cache, causing performance degradations. Consider a design that makes use of extend at class parse time. Here's a slide deck that explains in detail: What Makes Ruby Go

Comments

  1. Mark Wilden Mark Wilden on November 12, 2009 at 08:42PM

    The slide deck is deeply unconvincing.

    The authors compare running a standard benchmark with and without method caching. But Object#extend doesn't turn off method caching for all time--just once for each method.

    Then they call Object#extend six million times in a tight loop. If you're writing code like that, then you've got far bigger problems than method caching.

    They don't actually present any real-world situation to support the impression that Object#extend should be avoided for performance reasons.

    That said, the slides were very interesting, and other points they make further on do have practical applications.