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.
When a poll has a few results, the advpoll_approval_vote() funtion starts to get very slow. the reason is a call to in_array() for each result. Replacing this with a faster method to reduce the results has improved our site loading time for about 2 seconds.
Comment | File | Size | Author |
---|---|---|---|
#1 | advpoll-perfomance-2220217-1.patch | 456 bytes | daniel.bosen |
Comments
Comment #1
daniel.bosenComment #2
daniel.bosenComment #3
evilfurryone CreditAttribution: evilfurryone commented#1 works for me.
I had a situation where there were too many votes in the poll (20+K) and the webpage timed out. The patch got the results in seconds.
Comment #4
evilfurryone CreditAttribution: evilfurryone commentedForgot to change status before. Better late than never.
Comment #5
tripper54 CreditAttribution: tripper54 commentedClever fix, thanks for submitting. Committed!