-
John Hawthorn authored
This commit makes two performance tweaks to the dispatch_cache in Arel::Visitors::Visitor. First, it interns the method name into a symbol rather than a string. send expects a symbol, so this avoids Ruby needing to intern that string itself. Second, it changes the dispatch cache to an identity hash. Classes are already compared by identity, but Ruby is able to perform the lookup more quickly if it is explicit on the hash.
John Hawthorn authoredThis commit makes two performance tweaks to the dispatch_cache in Arel::Visitors::Visitor. First, it interns the method name into a symbol rather than a string. send expects a symbol, so this avoids Ruby needing to intern that string itself. Second, it changes the dispatch cache to an identity hash. Classes are already compared by identity, but Ruby is able to perform the lookup more quickly if it is explicit on the hash.
Loading