Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: 93533e98f76c
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 91586661c983
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Dec 18, 2014

  1. stream: switch _writableState.buffer to queue

    In cases where many small writes are made to a stream
    lacking _writev, the array data structure backing the
    WriteReq buffer would greatly increase GC pressure.
    
    Specifically, in the fs.WriteStream case, the
    clearBuffer routine would only clear a single WriteReq
    from the buffer before exiting, but would cause the
    entire backing array to be GC'd. Switching to [].shift
    lessened pressure, but still the bulk of the time was
    spent in memcpy.
    
    This replaces that structure with a linked list-backed
    queue so that adding and removing from the queue is O(1).
    In the _writev case, collecting the buffer requires an
    O(N) loop over the buffer, but that was already being
    performed to collect callbacks, so slowdown should be
    neglible.
    
    PR-URL: #8826
    Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
    Reviewed-by: Trevor Norris <trev.norris@gmail.com>
    chrisdickinson committed Dec 18, 2014
    1
    Copy the full SHA
    9158666 View commit details
    Browse the repository at this point in the history