-
Notifications
You must be signed in to change notification settings - Fork 110
method_missing for helpers is slow #114
Copy link
Copy link
Open
Description
Hi there, thanks for creating such a great project!
We noticed that a particular request in our Rails app was slow. Eventually we traced the problem to a decorator that was calling image_tag. Each call results in a method_missing through ActiveDecorator, which delegates to the view context. The overhead for each call is around 1ms, and we are calling image_tag 100 times, so the decorator was slowing down the page by 100ms.
Not sure about the proper fix. Can we mix in the helpers directly somehow, instead of relying on method_missing & view context? Should we call define_method to add missing methods as they are detected? Should we expose view_context and force decorators to call it directly?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels