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.

CommentFileSizeAuthor
#1 advpoll-perfomance-2220217-1.patch456 bytesdaniel.bosen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daniel.bosen’s picture

daniel.bosen’s picture

Status: Active » Needs review
evilfurryone’s picture

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

evilfurryone’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to change status before. Better late than never.

tripper54’s picture

Status: Reviewed & tested by the community » Fixed

Clever fix, thanks for submitting. Committed!

Status: Fixed » Closed (fixed)

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