[Pmwiki-users] PHP-question -- sharing data between invocations

H. Fox haganfox
Tue May 4 16:11:52 CDT 2004


Christian Ridderstr?m wrote:
> I started thinking about performance related to the question of
> knowing the names of all wiki pages. Now I wonder if it's possible to
> share information between invocations of pmwiki.php. E.g. the first
> time pmwiki.php is called, it creates a hash-list with the names of
> all pages. The second time pmwiki.php is called, this list is already
> created. (I guess this is basically a cache).
> 
> One solution could be to write the hash-list to a file on a
> RAM-drive, but I wonder if there is some other mechanism that'd allow
> the variable (hash-list) to "stay in RAM", so that it's available for
> the next invokation.

If the hash-list is written to a file wouldn't it be held in the 
filesystem cache (RAM) by the OS, or possibly hardware hardware cache 
memory, if it has been accessed recently?

The directory would need to be read in order to check if any WikiPage is 
newer than the hash list.  If not, the hash-list file would be used, 
enhancing performance.  If the hash-list file isn't current, a new one 
would be created and written to disk, degrading performance.  The 
hash-list file would (nearly) always be current if a new one were 
created as part of saving a page.

Maybe the hash-list file could contain some extended information about 
pages that would reduce reads or somehow otherwise enhance performance. 
  I suppose that means the file becomes an index rather than a cache...

(Hopefully my points come through despite possible terminology misuse.)

Hagan



More information about the pmwiki-users mailing list