Skip to content

geotiler performance note #35

@time4tea

Description

@time4tea

hiya - thanks for your library, it is very nice, and I use it in https://github.com/time4tea/gopro-dashboard-overlay

as the rendering code in my project gets called a lot - i was looking for places that I could make some easy gains in performance - so i ran the rendering code in viztracer.

I got the following trace:
viztracer before

as you can see there is quite some time spent in PIL imagedecode - this seems to be because the cache in the system caches the data files, but there is no image cache in the library. When drawing maps in my program we reuse map tiles a lot, as the map is moving pixel by pixel around the place.

i couldn't find a good place to put an image cache in, so i kind of bodged it, and ended up with a trace that looks like this:

viztracer after

you can see that the time to create the image is much reduced - from about 7.5ms to about 1ms - assuming a cached tile.

The code is smashed in right now, so no prizes for quality - but you are welcome to it if it is useful for you.

https://github.com/time4tea/gopro-dashboard-overlay/blob/geotiler-perf/gopro_overlay/geo_render.py

It is a "drop-in" replacement for the geotiler.render_map (at least how I use it)

Hope this is useful/interesting - anyhow thanks for making a nice library.

Cheers!

James

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions