Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.