Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

making the comment more accurate

  • Loading branch information...
commit a620105a15feb881be524ea542386bb911cffc85 1 parent 532f89f
@tenderlove tenderlove authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 activerecord/lib/active_record/attribute_methods/read.rb
7 activerecord/lib/active_record/attribute_methods/read.rb
@@ -33,8 +33,11 @@ def cache_attribute?(attr_name)
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.