Performance Impact of Generating 100's of Dynamic Methods in Ruby?
- by viatropos
What are the performance issues associated with generating 100's of dynamic methods in Ruby?
I've been interested in using the Ruby Preferences Gem and noticed that it generates a bunch of helper methods for each preference you set.
For instance:
class User < ActiveRecord::Base
preference :hot_salsa
end
...generates something like:
user.prefers_hot_salsa? # => false
user.prefers_hot_salsa # => false
If there are 100's of preferences like this, how does this impact the application? I assume it's not really a big deal but I'm just wondering, theoretically.