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

I don't mind my earlier work being thrown out if it is shown to be wrong/buggy, which it has been in this case.

I didn't realize only a handful of mappings make use of that code path; it still bothers me a bit, but your fix seems to be the better solution for the time being.

A `DelegateMethodBuilder` being created for each delegate is certainly more of an issue. I've been thinking of rewriting the DelegateBuilder a few times now, as its becoming a bit of a mess; but each time I get foiled by MacRuby lacking a feature (such as subclassing the Module class). It's relatively high on my TODO list for HotCocoa, right after auto layout. If you'd like to try first, you are welcome to do so.

Optimizing for specific use cases is the more pragmatic approach, and I sometimes forget about that. :( Though some cases we want to optimize need more general fixing/refactoring. Optimizing startup time is something that we should be able to do, at least the HotCocoa part of startup, loading Cocoa itself is responsible for ~1 second of the startup time and we can't do anything about that.

I'm not sure that we can optimize specific mappings in a non-trivial way; Application and Window mappings already seem to do very little work. The pipeline that the Mapper follows for constructing objects is, I think, what needs to be optimized or rethought a bit in order to gain performance. Some work has gone into doing this already, but as usual, there is still so much more that could be done.