-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming responses #37
Comments
Good point, it looks as if the |
I could discuss a PR with my employer, but I'd first need to have #36 resolved. |
I've also done some more research and found that this is not the bottleneck, memory-wise. The tile is sent over the wire by PostgreSQL as ASCII hex. psycopg reads the entire tile into memory in that format, then decodes it into a separate buffer, so at that point the memory use is 3x the size of the tile. Fixing this issue would therefore not reduce the peak memory use. For that, the |
This point is resolved. I'm working on a 1.0 refactor and release. If you contribute a PR I can implement it in 0.2.1 and 1.0 versions |
In this line...
django-vectortiles/vectortiles/postgis/mixins.py
Line 58 in 86f0087
the entire MVT response from PostGIS is converted to a
bytes
object. That means it has to be in memory twice, once as amemoryview
and once as abytes
. I'm wondering if this is necessary, since Django performs the same conversion. If the conversion were not there, a caller could intercept thememoryview
and make aStreamingHttpResponse
out of it, so that it only needs to be in memory once.The text was updated successfully, but these errors were encountered: