Problem/Motivation

Was doing some performance testing and noticing a high number of t() calls from views_fetch_fields(). They are all the same 5 strings being translated so we can build them 5 times and avoid the call 1000s of times.

Proposed resolution

Make the calls early and outside the nested loop.

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Issue summary: View changes
StatusFileSize
new2.51 KB
joelpittet’s picture

Status: Active » Needs review
joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

Works as advertised.

joseph.olstad’s picture

Issue tags: +minor version target

joelpittet has done some great work here. Adding the 'minor version target' tag.
Please include this for 7.x-3.17

joseph.olstad’s picture

These other performance fixes all play nice together. I recommend all of them for 7.x-3.17 please and thanks.

dsutter’s picture

RTBC+ patch #2

gdaw’s picture

Nice performance boost thanks joelpittet, we have been using these for some time now.

RTBC for patch #2

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: reduce_the_calls_to_the-2760405-2.patch, failed testing. View results

damienmckenna’s picture

Could someone please reroll this? Thanks.

joseph.olstad’s picture

Status: Needs work » Needs review
StatusFileSize
new2.52 KB

rerolled for 7.x-3.x latest

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

it was only a whitespace difference that caused the patch to fail.
returning to RTBC because it's the exact same code, except without the broken empty line.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed.

Status: Fixed » Closed (fixed)

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