• Dale Curtis's avatar
    Optimize the performance of media::ByteQueue. · b710e196
    Dale Curtis authored
    This changes a few things about the ByteQueue class:
    - Growth is now done as std::max(size_needed, 1.25 * size_) in line with
    how base::circular_deque grows -- in local tests this seems to yield a
    significant memory savings depending on the content.
    - In rare cases where there's no used data, the existing allocation is
    released before a new one is acquired (to reduce total memory pressure).
    
    BUG=none
    TEST=Android bot shows ~1-3% reduction in memory.
    
    Change-Id: Iec376d61bff08fa4723129aed9edb03bb220c7b4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1691581
    Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
    Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
    Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#676181}
    b710e196
byte_queue.cc 2.49 KB