Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

#1991 - ObjectPool approach #3702

Closed
wants to merge 1 commit into from

Commits on Oct 7, 2015

  1. Allow DefrateStream and OutputWindow to pool internal resources that …

    …causes stress allocation when DefrateStream is used in high throughput small data packages. Those commonly happen in web servers which accept gzipped incoming connections and must respond accordingly. DefrateStream will allocate for reuse up to 256Kb of memory (or up to 32 concurrent streams without allocations) and will apply both to ZLib and Managed versions. On the managed implementation (InfrateManaged), there will exist a reservation of up to 512Kb of memory (or up to 16 concurrent compression streams without allocations). The rationale is that on the web server scenario messages are paired, one incoming and one outgoing, therefore there are half as many InfrateManaged than total DefrateStreams.
    
    Reservations happen lazily, therefore in low throughput scenarios the probability of allocating the whole 768Kb is pretty low.
    
    Fix: #1991
    redknightlois committed Oct 7, 2015
    Configuration menu
    Copy the full SHA
    c6bed66 View commit details
    Browse the repository at this point in the history