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?
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 amethod_missingthrough 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_methodto add missing methods as they are detected? Should we exposeview_contextand force decorators to call it directly?