#24242: compress_sequence creates a larger content than no compression -------------------------------------+------------------------------------- Reporter: dracos | Owner: nobody Type: | Status: closed Cleanup/optimization | Component: HTTP handling | Version: 1.7 Severity: Normal | Resolution: fixed Keywords: | Triage Stage: Ready for | checkin Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Tim Graham <timograham@…>): In [changeset:"2a55301f9fe1c3b62ad4e79c3109bec77b57b317"]: {{{ #!CommitTicketReference repository="" revision="2a55301f9fe1c3b62ad4e79c3109bec77b57b317" [1.8.x] Fixed #24242 -- Improved efficiency of utils.text.compress_sequence() The function no longer flushes zfile after each write as doing so can lead to the gzipped streamed content being larger than the original content; each flush adds a 5/6 byte type 0 block. Removing this means buf.read() may return nothing, so only yield if that has some data. Testing shows without the flush() the buffer is being flushed every 17k or so and compresses the same as if it had been done as a whole string. Backport of caa3562d5bec1196502352a715a539bdb0f73c2d from master }}} -- Ticket URL: <https://code.djangoproject.com/ticket/24242#comment:6> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.e7474531f7755683c188f6f36eac953f%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.