just a thought, but poge.replace_html not only generates the html from the
partial, but also a little javascript to actually do the work of the
replace. It also has to go through all the generated html and escape it i
believe, as it generates one long string which is used in the javascript
call..
On 8/17/06, Trey Bean <trey@treybean.com> wrote:>
> I know that isn''t supposed to be the case, and it usually
isn''t, but
> today, I''ve run across a situation where rendering the same
partial
> through RJS is taking about 5 times longer than rendering the partial in
> the RHTML.
>
> I have in my main RHTML
>
> <tbody id="account_transactions">
> <%= render :partial =>
''account_transactions/transaction'',
> :collection
> => @account_transactions, :locals => {:nobalance => false, :goto
=>
> false} %>
> </tbody>
>
> By putting a benchmark around just the render line, it renders on
> average 0.3 seconds.
>
> Now I have a link on the page to go to another page (AJAX paging is the
> thought) and everything processes in a timely fashion except this line:
>
> page.replace_html "account_transactions", :partial =>
> ''account_transactions/transaction'', :collection =>
> @account_transactions, :locals => {:nobalance => false, :goto =>
false}
>
>
> It continually takes about 2.1 seconds.
>
> Does anyone have any idea on why rendering the same thing would take
> that much longer? The collection contains 25 objects and for each
> object, two sub partials are rendered.
>
> Thanks,
> Trey
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Mark Van Holstyn
mvette13@gmail.com
http://lotswholetime.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/354577ad/attachment.html