deps: improve ArrayBuffer performance in v8
authorFedor Indutny <fedor@indutny.com>
Tue, 8 Sep 2015 00:40:43 +0000 (17:40 -0700)
committerRod Vagg <rod@vagg.org>
Tue, 8 Sep 2015 09:36:28 +0000 (19:36 +1000)
commite1c976184d724b7f79e9696ce8e9c17db0352de6
treea4204013642dd0beacbb7b6303e80ed224abdf35
parentc60857a81ad9f0a6c66cda3ba5a8bbaa94f5b63b
deps: improve ArrayBuffer performance in v8

This a backport of the following commits from the v8's upstream:

1a8c38c50513f9af07ada479629a653e1cf36ff3
206f12abee3f1e7eda8fc6521d48f3c319460ee1
9e3676da9ab1aaf7de3e8582cb3fdefcc3dbaf33

Original commit message:

    heap: make array buffer maps disjoint

    Remove intersection from the `std::map`s representing current live
    ArrayBuffers. While being simpler to understand, it poses
    significant performance issue for the active ArrayBuffer users (like
    node.js).

    Store buffers separately, and process them together during
    mark-sweep phase.

    The results of benchmarks are:

    $ ./node-slow bench && ./node-fast bench
    4997.4 ns/op
    4685.7 ns/op

    NOTE: `fast` - was a patched node.js, `slow` - unpatched node.js
    with vanilla v8.

PR-URL: https://github.com/nodejs/node/pull/2732
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
deps/v8/src/heap/heap.cc
deps/v8/src/heap/heap.h
deps/v8/src/heap/mark-compact.cc