During the 1.7 dev cycle, I removed caching of module and class names due to the complexity of supporting their updates when classes and modules enclosing them have their names updated. Specifically, I could not find an efficient way for a class contained within an anonymous class to get a new, non-anonymous name when the anonymous container gains a name later on.
As a result, the performance of Class#name and Module#name has degraded in the 1.7 dev branch (master).
We could potentially still compensate for this degradation with a new form of caching. I have made such an attempt and posted it here: https://gist.github.com/1372628
I use the constant cache invalidation as a way to know that somewhere, some name has been updated. It does not pass tests, but I think it's possible for us to fix it.