[ka-Map-users] Some thoughts/questions about tile.php

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jul 13 15:32:34 EDT 2006


Hello Paul, et al,

I have been looking at tile.php and had some thoughts/questions about 
how it works and how it might be made faster.

1) currently the first thing it does is open lock file on the metatile
2) if the file exist, it gets a shared lock
3) serves the image
4) removes the lock

It seems like it would be faster to avoid this locking, ie: if the file 
exists just serve it. If image creation were written to a tmp file name 
and renamed to the actual tile name when the write was done and the file 
closed, this would be atomic and should avoid the problem that the code 
above is dealing with.

Since the whole concept of tiled mapping is to generate once and serve 
many times it seems this would be a valuable performance improvement by 
avoiding 3 file operations per tile requested.


Second issue is that directory structure is pretty flat as Paul has 
mentioned in the past. I was thinking that a very trivial change would 
be to split the directories tnnnnn-lnnnnnn into tnnnnn/lnnnnnn which 
would significantly reduce the number of entries in any given directory.

Any thoughts or issues on these would be appreciated.

Best regards,
   -SteveW


More information about the ka-Map-users mailing list