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.
Comment | File | Size | Author |
---|---|---|---|
#17 | interdiff-2595209-13-15.txt | 4.27 KB | mglaman |
#15 | 2595209-15.optimize_commerce_product_reference_entity_view.patch | 4.06 KB | rszrama |
| |||
#13 | 2595209-13.patch | 4.33 KB | joelpittet |
| |||
#13 | interdiff.txt | 2.73 KB | joelpittet |
#3 | after-XHProf__Hierarchical_Profiler_Report.png | 241.22 KB | joelpittet |
Comments
Comment #2
joelpittetThis saved about 16ms on a product listing page. Depending on your setup you could save more;)
Comment #3
joelpittetActually this is nicer, saves nearly 100ms.
Not as quick of a fix
Comment #4
joelpittetComment #5
mglamanComment #6
mglamanGiving it a test run with CK2's Behat https://travis-ci.org/mglaman/commerce_kickstart/builds/97034950
Comment #7
mglamanThis looks good to me. Tests pass on CK2, manually reviewed and found no issues. Moving calls out of loops that don't need to be is always a win.
Comment #9
rszrama CreditAttribution: rszrama at Centarro commentedIs this two patches combined in one? Didn't see an explanation for the switch in wrapper usage - and it's kinda funky to see something like this:
Comment #10
joelpittet@rszrama that is funky, it was to avoid other changes (minimizing the diff of name changes). Don't think it's two patches combined all relate to the performance of that one super large function.
Comment #11
rszrama CreditAttribution: rszrama at Centarro commentedOk, I'll review. I was originally under the impression the real trick here was moving drupal_get_path() out of the foreach, but I see it's also these other function calls, including not invoking the wrapper in the foreach. I'll probably clean up the variable names before committing.
Comment #12
joelpittet@rszrama I'll look at this again, maybe I can unfuddle the variable naming without too much hunk changes.
Comment #13
joelpittet@rszrama the big reason for getting the reference value early is to avoid the count() on the EMW value.
If you feel comfortable committing part and not the other then LMK and I'll split this issue.
Hopefully these changes make it easier to review and not so funky;)
Comment #14
mglamanCourtesy CK2 Behat test run https://travis-ci.org/mglaman/commerce_kickstart/builds/97526318
Comment #15
rszrama CreditAttribution: rszrama at Centarro commentedOk, think I wrapped my head around all the changes. Two observations:
Patch attached.
Comment #16
joelpittet@rszrama cool, can you throw up an interdiff please?
Comment #17
mglamanAttached interdiff of #13 to #15
Comment #18
torgosPizzaComment #19
torgosPizzaC'mon testbot!
Comment #20
joelpittetThanks for the interdiff @mglaman I've went through and it looks good:) @rszrama it's RTBC from me but I'll let a sober second set of eyes on it.
Comment #21
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedPatch looks good to me, only one tiny nitpick, this comment really only makes sense in the context of this patch, once this is committed, the comment seems unnecessary and slightly confusing, it's not like we explain the scope of every variable we set.
Comment #22
rszrama CreditAttribution: rszrama at Centarro commentedCommitted.