It sounds like this project is coming along. Any chance we can see some xhprof style profiling of a "standard" site before and after this module is enabled?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | performance-benchmark-3.png | 50.56 KB | Caseledde |
| #2 | performance-benchmark-2.png | 49.88 KB | Caseledde |
| #1 | performance-benchmark.png | 49.87 KB | Caseledde |
Comments
Comment #1
Caseledde commentedSure, here we go:
For the test, I created three differnt kinds of nodes:
I created the benchmark for 'Node Complex Fields' and 'Node Complex Preprocess' to figure out what the pros and cons of field cache vs. full cache are.
Additionally I run a benchmark with Panels. This is because panels uses entity_view() and if this function is called the renderable array is cached also.
The results in miliseconds are:
I attached an image with a graph for a better overview.
Comment #2
Caseledde commentedThere were an issue with caching the renderable array #1997458: It doesn't work!!.
So I re-run th benchmarks with full cache and panels. The new results are:
Comment #3
thedavidmeister commentedcool. Would you mind showing how much we gain using this module when Entity Cache is already in effect?
Comment #4
Caseledde commentedResults with entitycache enambled:
Comment #5
thedavidmeister commentedwow, so this actually has *more* of an impact on render times than entity object caching? that's impressive.
Comment #6
fmizzell commented@thedavidmeister, yeah, rendering is stupidly expensive.
@Caseledde. I did some comparisons of display_cache with a custom solution I have, and I found that caching the html directly is quite a bit faster than just allowing core to cache the render array. My solutions suffers from the asset management issue, since #attached won't work, but that is something that display_cache can definitely solve . I did not do as formal a test as yours, but I saw extra improvements of up to 30%. If you have some time to waste, maybe you can see if this can be corroborated in a more formal manner, and I do not believe that it would be hard to modify the code to allow for this form of caching, if the user wants it.
Comment #7
fmizzell commentedNevermind. I modified display_cache to save the html instead of the renderable array, but there was no significant improvement. Then I tested display_cache against my more simplistic custom implementation, and my implementation performs about 60% better. Then I had to do some profiling to see what was going on. During my test I profiled a page that displays 50 entities with their displays cached. While checking the profiling info I noticed that both methods call cache_get 50 times (obviously), yet the inclusive wall time of display_cache was around 235000 microseconds, while the inclusive wall time of my implementation's cache_get was around 45000. I guess I will have to dig into cache_get to see what could be causing the big difference.
Comment #8
thedavidmeister commented#7 - this is obviously a huge stab in the dark, but is it notice errors being thrown and maybe suppressed slowing things down? do you have your error reporting set to display everything?
Comment #9
Caseledde commented#7 - You're absolutely right. Caching of the renderable array is waste if the rendered and cached html output already is an renderable array. (uses just'#markup' instad of all etc.) So display_cache_view_entity will return the cache entry from the rendered output now.
Just commited these changes.
Comment #10
fmizzell commented@thedavidmeister I apologize for the stab in the dark, I just wanted to try to prove what I had claimed in #6, but ultimately it just brought new questions. I will continue to dig in, but I might not have any time until Friday. I will check the error logs to see if I find anything that seems related.
Comment #11
jstollerAm I reading #4 right? Does having Entity Cache installed along with Display Cache cause simple nodes to load slower? I don't understand why that would be the case.
Comment #12
kopeboyJust a question: how should I include my display-cached node in Panels (with the provided Node template) to have the best performance?
The panes you get are called:
which of course render the same content, but code/performance may differ?
Comment #13
Chris CharltonDo we want to continue this ticket? Or is it done? Updating isn't out of the question. And wouldn't the result charts benefit the project detail page for others to see there is clear performance net gains for some sites using this module.