Working with https://www.drupal.org/project/quiz_item_analysis I noticed a lot of node_load() calls that were duplicate.
Here's a quick fix to avoid the db calls for the same question nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2940785-6.patch | 1.19 KB | joelpittet |
| #3 | 2940785-3.patch | 1.33 KB | joelpittet |
Comments
Comment #2
joelpittetComment #3
joelpittetComment #4
joelpittetComment #5
joelpittetComment #6
joelpittetForgot to use static for the call repeats.
Comment #7
djdevinI thought node_load() already had a static cache? Are you seeing improved performance?
Comment #8
joelpittetIt wouldn’t run without it and I had upped the timeout too 160 s and memory was at 512M already.
I thought it did too but that change helped a lot!
Comment #9
joseph.olstadNice patch @Joelpittet
using this patch in production, works as advertised.
Comment #11
smustgrave commentedWith D7 approaching EOL I've started the triage of the D7 queue here. Since this is small and RTBC going to merge. Will plan 1-2 D7 releases in the coming months.
Comment #12
joseph.olstadThanks!