SUCHST DU VIELLEICHT SOWAS?
@fotos ||= Foto.find(:all)
Herzliche Grüße,
Michael
Am 24.04.2008 21:47 Uhr schrieb "Mario Schroeder" unter
<[EMAIL PROTECTED]>:
> Ich habe meinen Code etwas mit Partials refaktorisiert und dabei ist mir
> etwas sehr komisches aufgefallen.
>
> Machen Partials, den Code wirklich schneller?
>
> Der Aufruf der Seite ohne Partials
>
> Processing TestController#index (for 127.0.0.1 at 2008-04-24 05:58:49) [GET]
> Session ID:
> BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHV
> zZWR7AA%3D%3D--0e8978eceabed68867bc817030867ffde4dd75f3
> Parameters: {"action"=>"index", "controller"=>"Test"}
> Test Load (0.002644) SELECT * FROM tests
> Partner Load (0.004678) SELECT * FROM partners
> Rendering template within layouts/application
> Rendering Test/index
> Completed in 0.06608 (15 reqs/sec) | Rendering: 0.04643 (70%) | DB:
> 0.00732 (11%) | 200 OK [http://localhost/test]
>
>
>
>
> Der Aufruf der Seite mit Partials
>
> Processing testController#index (for 127.0.0.1 at 2008-04-24 05:52:45) [GET]
> Session ID:
> BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHV
> zZWR7AA%3D%3D--0e8978eceabed68867bc817030867ffde4dd75f3
> Parameters: {"action"=>"index", "controller"=>"test"}
> Test Load (0.002790) SELECT * FROM tests
> Partner Load (0.004675) SELECT * FROM partners
> Rendering template within layouts/application
> Rendering test/index
> Rendered layouts/_socialbookmark (0.00071)
> Rendered layouts/_analytics (0.00133)
> Completed in 0.04672 (21 reqs/sec) | Rendering: 0.02718 (58%) | DB:
> 0.00746 (15%) | 200 OK [http://localhost/test]
>
>
>
> Es werden an beiden Stellen die gleichen Daten geladen, einmal mit
> Partials und einmal ohne. Wenn ich die Ausgabe in den Logs richtig lese,
> dann ist die Seite mit Partials wirklich schneller..... kann das sein?
>
> Warum baue ich dann nicht jede Seite mit Partials?
>
> _______________________________________________
> rubyonrails-ug mailing list
> [email protected]
> http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug