From a04851702b0e8e694a92139c3ee9f3b1622f3f5d Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 18 Nov 2014 15:27:42 -0800 Subject: Use class objects rather than strings for the dispatch cache The only reason we're using strings is to pre-populate the cache, but `Class#name` returns a new string instance on every call. This is a pretty major source of memory usage. We don't technically need to pre-populate the cache, and not doing so allows us to go back to using cache objects --- test/visitors/test_to_sql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 7895866809..2e3f7f8624 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -36,7 +36,7 @@ module Arel end def dispatch - { Arel::Table.name => 'hello' } + { Arel::Table => 'hello' } end }.new -- cgit v1.2.3