The results of benchmarks are:
./node-slow 1 && ./node-no-inline-fast 1 && ./node-fast 1
4997.4 ns/op
4701.6 ns/op
4685.7 ns/op
NOTE: `no-inline-fast` is the initial version of patch, `fast` - is current,
`slow` - vanilla v8.
The other thing that I have noticed is that there are not much scavenges
happening:
[65202:0x101804c00] 22 ms: Scavenge 1.9 (38.0) -> 1.8 (38.0) MB, 0.6
ms
[allocation failure].
[65202:0x101804c00] 23 ms: Scavenge 2.0 (38.0) -> 2.0 (39.0) MB, 0.5
ms
[allocation failure].
[65202:0x101804c00] 48 ms: Scavenge 3.5 (39.0) -> 3.1 (39.0) MB, 3.4
ms
[allocation failure].
[65202:0x101804c00] 57 ms: Mark-sweep 3.7 (39.0) -> 2.9 (40.0) MB,
4.7 ms
[external memory allocation limit reached.] [GC in old space requested].
[65202:0x101804c00] 68 ms: Mark-sweep 3.4 (40.0) -> 2.9 (40.0) MB,
9.4 ms
[external memory allocation limit reached.] [GC in old space requested].
[65202:0x101804c00] 81 ms: Mark-sweep 2.9 (40.0) -> 2.9 (40.0) MB,
12.4 ms
[external memory allocation limit reached.] [GC in old space requested].
[65202:0x101804c00] 82 ms: Mark-sweep 2.9 (40.0) -> 2.7 (40.0) MB,
1.7 ms
[external memory allocation limit reached.] [GC in old space requested].
[65202:0x101804c00] 91 ms: Mark-sweep 3.3 (40.0) -> 2.7 (40.0) MB,
3.4 ms
[external memory allocation limit reached.] [GC in old space requested].
I guess making them a scavenges might be the next step to improve the
performance.
Thanks for review!
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc
File src/heap/heap.cc (right):
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc#newcode1752
src/heap/heap.cc:1752: void Heap::UnregisterArrayBuffer(bool
in_new_space, void* data) {
On 2015/08/28 14:25:30, Michael Lippautz wrote:
We can simplify the main part a lot:
std::map<void*, size_t>*live_buffers =
in_new_space ? &live_array_buffers_for_scavenge_ :
&live_array_buffers_;
std::map<void*, size_t>* not_yet_discovered_buffers =
in_new_space ? ¬_yet_discovered_buffers_for_scavenge_ :
¬_yet_discovered_buffers_;
DCHECK(live_array_buffers->count(data) > 0);
live_array_buffers->erase(data);
not_yet_discovered_array_buffers->erase(data);
Acknowledged.
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc#newcode1761
src/heap/heap.cc:1761: not_yet_discovered_array_buffers_.erase(data);
On 2015/08/28 14:25:30, Michael Lippautz wrote:
This .erase() will not be part of the method as we keep the sets
disjoint.
Acknowledged.
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc#newcode1776
src/heap/heap.cc:1776: if (from_scavenge) {
This one will need to become unconditional.
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc#newcode1784
src/heap/heap.cc:1784: void Heap::FreeDeadArrayBuffers(bool
from_scavenge) {
On 2015/08/28 14:25:30, Michael Lippautz wrote:
Since we keep the sets disjoint, we only need to visit XXX_scavenge_
for the new
space part and in the other case we visit all of them:
for buffer in not_yet_discovered_buffers_scavenge:
isolate.free(buffer)
freed_memory += …
live_array_buffers_for_scavenge_.clear(buffer)
if !from_scavenge:
for buffer in not_yet_discovered_buffers_:
isolate.free(buffer)
freed_memory += …
live_array_buffers_.clear(buffer)
not_yet_discovered_buffers_for_scavenge_ =
live_array_buffers_for_scavenge_
if !from_scavenge:
not_yet_discovered_buffers_ = live_array_buffers_
Acknowledged.
https://codereview.chromium.org/1316873004/diff/20001/src/heap/heap.cc#newcode1828
src/heap/heap.cc:1828: void Heap::TearDownArrayBuffers() {
On 2015/08/28 14:25:30, Michael Lippautz wrote:
nit: While practically not relevant, we should still tear down gentle
and record
the freed memory (like in FreeDeadArrayBuffers).
e.g.
freed_memory += buffer.second;
throughout the loop
and
AdjustAmountOfExternalAllocatedMemory(freed_memory);
in the end.
Acknowledged.
https://codereview.chromium.org/1316873004/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.