fawick / go-mapnik

Go bindings for mapnik (http://www.mapnik.org or http://github.com/mapnik/mapnik)
BSD 3-Clause "New" or "Revised" License
60 stars 18 forks source link

Reads from and writes to mbtiles database are inefficient #8

Open nkovacs opened 9 years ago

nkovacs commented 9 years ago

There's only a single goroutine that serves reads from the mbtiles database. This is very slow, especially since the reads are blocking. m.fetch should run in a goroutine. Similarly m.insert should also be executed in a goroutine. Sqlite should be able to handle locking.

fawick commented 9 years ago

Whether sqlite supports multi-threading depends on how it was compiled. The safe assumption is that it was compiled without multi-threading support, especially given the fact that the go-sqlite3 is not vendored in go-mapnik and hence it's compile options might change.

Having said that, I agree that the current code is not optimal. I have noticed you already starting hacking around in a fork of yours. I'll be happy to take in a pull request and collaborate with you on improving things.