I managed to get many of the &block's removed and did not notice a performance gain. I think that since most delegate down to a few core methods that require the &block argument in order to eval the binding, the gains are lost. Since there is no way to eval a blocks binding without naming the argument, I think this little exercise of mine is failed :)
Just FYI. - Ken > OK, I'll take a look. About the only hot spot I saw was the block_is_haml? > method which relies on eval'ing using the binding. My meta-fu was not strong > enough to figure out a way around that. I'll see what I can come up with and > let you know. > > - Ken > > >> Sure, a patch to switch this to yield would be fine. >> >> On Sun, Jan 30, 2011 at 9:00 AM, Ken Collins <[email protected]> wrote: >> >> It is my understanding that using &block as an argument is both a >> performance hit and not needed. Much of the rails source itself has >> moved to yielding to the block in a method in various ways so that you >> do not have to convert that block to a proc object. Much of my own >> code has started to follow this pattern too. >> >> I am curious if anyone has considered removing all the &block >> arguments to measure the performance? I would be happy to fork and >> work on a patch, but I just wanted to gauge if this topic has come up >> before. -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/haml?hl=en.
