Project

General

Profile

Actions

Patch #1321

closed

Precache all settings

Added by Philip Hofstetter over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Administration
Target version:
-
Start date:
2008-05-28
Due date:
% Done:

0%

Estimated time:

Description

While setting up my local development environment to have a look at bug #1313, I noticed that the database was hit multiple times to read settings - once per setting. This seems like an awfully stupid thing to do, as multiple settings usually need to get read anyways.

Also, there is a caching mechanism in place, but it only works for multiple reads of the same value per request. Also, there is code to check for settings cache freshness and flushing the cache, but the cache-flushing function is called once per request and the cache works for one request only anyways.

This lead me to devise the two attached patches. One (0001) preloads all settings into another class variable, the other (0002) gets rid of all the caching as it is not needed any more due to the settings being preloaded anyways.

This could be further improved by batch-loading the needed settings but it would require them to be known beforehand, otherwise we would get the old behaviour.

I know it's cosmetics, but still...


Files

0001-precache-all-settings.patch (1.35 KB) 0001-precache-all-settings.patch preload settings Philip Hofstetter, 2008-05-28 22:56
0002-remove-settings-cache-which-only-worked-per-request.patch (2.48 KB) 0002-remove-settings-cache-which-only-worked-per-request.patch remove not-really-functional caching Philip Hofstetter, 2008-05-28 22:56
Actions

Also available in: Atom PDF