[Tilesathome] Potential t at h optimization: Re-use the optimized .png image

Matthias Julius lists at julius-net.net
Thu Dec 18 20:10:21 GMT 2008


"Ævar Arnfjörð Bjarmason" <avarab at gmail.com> writes:

> When I render areas that aren't cityscape I note that most of the time
> to render each tile is being spent on the post-optimization and
> compression of the generated png file. If I look at the generated .png
> file I find that up to 95% of them share the same md5sum.

I would be surprised if so many tiles that are actually not empty
should have the same content.

Were you looking at empty tiles?

>
> If the PNG optimization and compression routines in Tileset.pm kept a
> record of the previous byte size of generated tiles (as reported by
> stat()) and if they matched ran md5sum() on them and if that matched
> simply copied over the old previously optimized tile instead of doing
> the work again a speedup could be gained. Large amounts of the tiles
> on the planet probably have some duplicate parts.

I guess you were looking at empty tiles (67 or 69 bytes).  Empty tiles
are not optimized.  In fact, they are never written to disc.  When the
client finds during tile splitting that a tile is empty it throws the
tile away and copies emptyland.png or emptysea.png from the client's
root directory.  Those are actually 1 pixel PNGs with 67 respective 69
bytes size.

Matthias




More information about the Tilesathome mailing list