ferrous26/hotcocoa — comment on commit 8dd4fc52705cbc88c9e03b3526f3ef4a7f3bbf8d
File: lib/hotcocoa/delegate_builder.rb line 112
By benilovj:

I didn't mean to break your earlier work, I was just trying to fix a feature that I wanted to use in my application that wasn't working.

I think it's risky to optimise without having a concrete usecase in mind, as it's very easy to do a local optimisation that doesn't change the end-to-end performance. In this case, I believe that the performance implications will be minimal. The #to_s call is reached only for delegations that have parameters (a grep on the hotcocoa code revealed only 80 of such delegations) and I would hazard a guess that nobody is using this feature except for me (since it was broken and nobody said anything :) ). What probably has a much bigger performance implication is how the DelegateMethodBuilder is used (i.e. it's newed up for every delegate call) but that can be fixed with a simple memoization.

I propose that we agree on some use cases where we think performance is crucial (such as requiring the hotcocoa gem, and perhaps how long instanciating the application and window mappings takes, since every app will have those), do some benchmarking and profiling around those cases , and then optimise based on the feedback from those. What do you think?