Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrieving quoted table name directly from the class instead of re-calculating it from the connection is an order of magnitude faster ```rb class User < ActiveRecord::Base def self.qtn quoted_table_name end def self.cqtn connection.quote_table_name(table_name) end end ``` Ruby 2.2 / Rails 5.0: ``` User.qtn: 3003860.8 i/s User.cqtn: 259818.5 i/s - 11.56x slower ``` Ruby 3.2 / Rails 7.0: ``` Comparison: User.qtn: 13504395.2 i/s User.cqtn: 517189.1 i/s - 26.11x slower ```
- Loading branch information