News for hackers. Stuff that matters.
Re:Node.js memory benchmark confirms V8's GC may not be read... by mraleph on Wednesday September 29, 2010 @01:56PM (#1740357)
--trace-gc will show an endless sequence of mark-sweep/compacts.

I explained why that happens in my comment to the original post.

Re:Node.js memory benchmark confirms V8's GC may not be read... by felixge on Wednesday September 29, 2010 @02:05PM (#1740395)
Great comment! Anybody interested should check it out: http://hns.github.com/2010/09/29/benchmark2.html#comment-820...
Re:Node.js memory benchmark confirms V8's GC may not be read... by olegp on Wednesday September 29, 2010 @02:15PM (#1740449)
It explains why JSON parsing doesn't perform well, but doesn't explain the original benchmark results. Would be great to get a comment from @mraleph or the other V8 guys on that.
Re:Node.js memory benchmark confirms V8's GC may not be read... by mraleph on Wednesday September 29, 2010 @02:55PM (#1740620)
Speaking about GC behavior of other benchmarks:

1) one with Buffers is also causing mark-sweep/compact pauses (7-15ms each) because Buffer constructor calls AdjustAmountOfExternalAllocatedMemory which triggers full gc cycle if it thinks that too much memory is held outside V8.

2) GCs in string based benchmark are mainly scavenges taking 0 ms plus < 10 full collections taking <6ms each on my desktop.

That is all I can say. V8 GC is performing well here from my point of view.

Re:Node.js memory benchmark confirms V8's GC may not be read... by hannesw on Wednesday September 29, 2010 @03:13PM (#1740691)
I just found out the same. So I guess it must be some intra-VM data shifting? Anyway, I'll update my posting accordingly.
Re:Node.js memory benchmark confirms V8's GC may not be read... by mraleph on Thursday September 30, 2010 @03:19AM (#1742555)
I don't know node.js well enough to even make a guess here. Somebody needs to profile it.

Updating your post sounds like a nice idea. It created a lot of confusion among developers.

Re:Node.js memory benchmark confirms V8's GC may not be read... by hannesw on Thursday September 30, 2010 @05:11AM (#1742714)
Updated!
Re:Node.js memory benchmark confirms V8's GC may not be read... by hannesw on Wednesday September 29, 2010 @02:14PM (#1740440)
Yes, --trace-gc shows about 10 Mark-sweeps per second, each taking around 13 ms (no compacts though as far as I could see). But are those ~15% spent in GC are enough to explain the performance?
Re:Node.js memory benchmark confirms V8's GC may not be read... by mraleph on Wednesday September 29, 2010 @02:30PM (#1740521)
You were saying that V8 GC is failing here so I just explained why JSON.parse is especially bad for V8 GC.

Strictly speaking I am not even convinced that GC is bottleneck here. Only profiling can reveal the real bottleneck.

[I tried small experiment: used thirdparty pure-JS JSON parser instead of V8 JSON.parse --- that changed GC profile, but did not affect response time.]