What are the performance issues related to the creation of dynamic methods of 100 in Ruby?
I have been interested in using and seen that it generates a bunch of helpful methods for each priority you set.
For example:
class users & lt; ActiveRecord :: Base priority: hot_salsa end
... generates something like this:
user.prefers_hot_salsa? # = & Gt; Wrong user.prefers_hot_salsa # = & gt; False
If there are 100 such priorities, how will this affect the application? I think that this is not really a big deal, but I'm thinking theoretically.
Almost every Ruby program does this kind of thing like crazy - it's the standard Attr _
is done by the methods of families, which are used in many Ruby programs to get rid of a lot of penalties, many programs also do in other places - for example, this is method_missing < / Code> is incredibly common with hacks. I have never seen how it really works, but it is quite common that if this was an important problem, then it should have been kept in mind.
Comments
Post a Comment