Re: [SMARTY] cache dir size

From: Date: Thu, 04 Jul 2002 08:00:18 +0000
Subject: Re: [SMARTY] cache dir size
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5192@lists.php.net to get a copy of this message
Monte Ohrt wrote:
On another note, as of the latest CVS version, Smarty now keeps cache files all in one directory, except with the use of cache_id and compile_id. Those are all put under their respective subdirectories. As far as having 50,000 files in one directory, Smarty doesn't care but your operation system might not manage that too well. I've had 30,000 files under one directory under Solaris and it was still quick (except when trying to _view_ this directory, the terminal choked.) This is the original reason why all templates were hashed and placed into sub directories. It made the files an unrecognizable mess, but it made sure the cache files were split up into subdirectories fairly evenly. Thoughts about this?
The day I noticed that Smarty uses a hashed directory structure I thought that you had a good reason to do so and I commited a change to the PEAR-Cache file container. But I reverted it change within a few hours. I measured the PEAR-Cache under Solaris/Win XP/Win 2000 some time ago and found that it's not worth to use a hashed (nested) directory structure having a total of 10^5, 10^6 files. A flat structure gave me a slightly better performance. Anyway the speed difference was almost negliable (~5% as far as I remember). I never cared on the structure modern filesystems file loopup tables but generally speaking I'd say that they are capable to easily handle/locate 10^5/10^6 files per directory without a performance loss. Anyway, I expect only very few Smarty users to have caches with more that 100.000 entries... Ulf

« previous php.smarty.general (#5192) next »