_location_supported_countries causes a LOT of filesystem access every time it is called.

I would highly recommend caching this. Maybe even store it in a setting. Or possibly keeping a "countries.inc" file around.

CommentFileSizeAuthor
#2 location.inc_6.patch3.32 KBbdragon

Comments

ankur’s picture

You're right. Would you be willing to take a second to put up a patch?

bdragon’s picture

Assigned: Unassigned » bdragon
Status: Active » Needs review
StatusFileSize
new3.32 KB

Here's a patch against the DRUPAL-4-7 branch.

I tested visiting the admin/settings/location page three times, it seems to work nicely.

geodaniel’s picture

Version: 4.7.x-1.x-dev » 6.x-3.x-dev

This patch looks good to me and applies cleanly to HEAD. This should reduce overhead quite a bit on busy sites.

ankur’s picture

Status: Needs review » Fixed

... Applies cleanly after running the dos2unix utility to convert the Windows linebreaks. Anyway, this has been committed to HEAD and DRUPAL-4-7.

bdragon, thanks for the patch, sorry for the wait.

Anonymous’s picture

Status: Fixed » Closed (fixed)