[development] don't abuse variabes as storage system

Gerhard Killesreiter gerhard at killesreiter.de
Sat May 5 17:52:31 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dries Buytaert schrieb:
> 
> On 04 May 2007, at 16:17, Moshe Weitzman wrote:
> 
>> we tried this and Dries was not amenable at the time. Maybe a few more
>> opinions and modifications would help. See http://drupal.org/node/79008
> 
> I would be amenable if there were some benchmark results.  If the
> motivation is performance, that show me that it matters.  How much time
> is spent loading the variable data from the cache?

I think the main advantage would be having a smaller result set to pull
from mysql for each non-cached page request.

Drupal.org's variable table has currently 333 items and the variable
cache is about 30k.
Of the 333 items, 62 (or about 20%) store more than 30 characters, 40
more than 70.

The sum of all characters in the variable table is 20330 (apparently
serializing adds 50% storage requirement in this case).

The sum of the 40 strings which are longer than 70 characters is 16530
or more then 75% of the total. Even if serializing adds more overhead to
short strings, we should be able to cut the 30kb to 15kb if we elect to
simply not put long strings into the cached version of the table.

Now the question is: How significant is this?

To evaluate this we'd need to look at the total data transfer from the
database to the webserver and a number of other variables.

I don't expect that out usual "ab -n100 -c5" test would show a
significant difference, but on a website with a lot of visitors it might
help.

Cheers,
	Gerhard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGPMRffg6TFvELooQRAsaZAJ4gpyLXHQrLrXFHWdn66GZbCFG2owCfQFMT
LSaMSzW2/bhogvbUfRNEQYA=
=VEU6
-----END PGP SIGNATURE-----


More information about the development mailing list