Okay, I've tweaked this a little and pushed it.

The bad news is that the benchmarks don't register much change when 
running in :ugly mode. Some of the runs seemed to be 5-10% faster, but 
some seemed to be about the same amount slower, so it's hard to tell. I 
was hoping for something more dramatic than this.

However, the good news is that the benchmarks aren't perfect. I tested 
the patch with exceptionally deep and reasonably large nested partials, 
and the results were much more heartening. Before :ugly, the ratio 
between Haml time and ERB time for both of these correlated with the 
size/nestedness of partials. That is, 5-deep nesting might have Haml 
rendering at 1.5x slower than ERB, while 30-deep nesting might have it 
rendering 3x slower. However, with :ugly, Haml seems to be within 1.5x 
of ERB no matter how deep the nesting gets.

I'm not entirely sure what the cause of the 1.5x constant slowdown is. 
It doesn't seem to show up for the flat benchmarks. I'm guessing it has 
to do with the bookkeeping Haml::Buffer does, which can theoretically be 
entirely eliminated when :ugly is set. So there's a clear path for 
improvement.

If you want to benchmark this on your own, add 
"Haml::Template.options[:ugly] => true" immediately after haml/template 
is required in test/benchmark.rb. Then run "rake benchmark".

- Nathan

Wincent Colaiuta wrote:
> El 14/2/2008, a las 2:06, Nathan Weizenbaum escribió:
>
>   
>> I think your previous :ugly patch was better - although this one
>> achieves similar output, there doesn't appear to be any gain in
>> efficiency. Also, I'm not sure yet that I want :output_tabs
>> configuration to be available, so I'd rather not have :ugly tied to it
>> just yet.
>>     
>
> Well there is the other patch if you want it:
>
> http://pastie.caboo.se/151908
>
> Cheers,
> Wincent
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to