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.

CommentFileSizeAuthor
#6 2940785-6.patch1.19 KBjoelpittet
#3 2940785-3.patch1.33 KBjoelpittet

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Project: Quiz item analysis » Quiz
Version: 7.x-1.x-dev » 7.x-6.x-dev
Component: Code » Code - Quiz core
joelpittet’s picture

StatusFileSize
new1.33 KB
joelpittet’s picture

Status: Active » Needs review
joelpittet’s picture

Version: 7.x-6.x-dev » 7.x-5.x-dev
joelpittet’s picture

StatusFileSize
new1.19 KB

Forgot to use static for the call repeats.

djdevin’s picture

I thought node_load() already had a static cache? Are you seeing improved performance?

joelpittet’s picture

It 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!

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

Nice patch @Joelpittet
using this patch in production, works as advertised.

  • smustgrave committed d7134e28 on 7.x-5.x
    Issue #2940785 by joelpittet, djdevin, joseph.olstad: Help with memory...
smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

With 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.

joseph.olstad’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.