aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-02 17:42:54 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-02 17:42:54 -0700
commit65ec63f4ba011a1b46c6de83853ddc2da21bbc81 (patch)
tree00690e33f65da0e7fb6ddd770f226b8ba79d8529 /activerecord
parent59482f93ec84a54069ef720ed4ecf5c4a3d302a0 (diff)
downloadrails-65ec63f4ba011a1b46c6de83853ddc2da21bbc81.tar.gz
rails-65ec63f4ba011a1b46c6de83853ddc2da21bbc81.tar.bz2
rails-65ec63f4ba011a1b46c6de83853ddc2da21bbc81.zip
making the comment more accurate
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods/read.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb
index 2c8ae9c774..8b3df3cd07 100644
--- a/activerecord/lib/active_record/attribute_methods/read.rb
+++ b/activerecord/lib/active_record/attribute_methods/read.rb
@@ -33,8 +33,11 @@ module ActiveRecord
protected
# We want to generate the methods via module_eval rather than
- # define_method, because define_method is slower on dispatch and
- # uses more memory (because it creates a closure).
+ # define_method, because define_method is slower on dispatch.
+ # Evaluating many similar methods may use more memory as the instruction
+ # sequences are duplicated and cached (in MRI). define_method may
+ # be slower on dispatch, but if you're careful about the closure
+ # created, then define_method will consume much less memory.
#
# But sometimes the database might return columns with
# characters that are not allowed in normal method names (like