rsolr/rsolr — pull request #82 by jcoleman (2014-07-03 15:26:39+00:00)
Title: Refactor response parsing: remove instance extend.

Using per-instance `extend` calls is generally not a good pattern because it break's the Ruby VM's attempt to optimize by caching constants and method lookup. Using the per-instance `extend` style code here, for example, is definitely invalidating the global constant cache in the Ruby VM (and like the global/per-class method cache depending on the VM version.) You can confirm this by checking `RubyVM.stat[:global_constant_state]` on a VM that supports RubyVM stats (such as MRI 2.1.) This patch maintains the same behavior, but eliminates the usage of per-instance `extend` so that we don't invalidate the global constant cache harming performance for every app using RSolr after every Solr call.