3 ms·
At NodeConf Summercamp this week Ryan Dahl remarked that the V8 team is very responsive and happy to fix to reports such as "this part of V8 is slow and shouldn
by maxogden 15y ago
At NodeConf Summercamp this week Ryan Dahl remarked that the V8 team is very responsive and happy to fix to reports such as "this part of V8 is slow and shouldn't be, can you please make it faster".
He also acknowledged that Google is obviously building V8 for Chrome and not Node and shouldn't be expected to spend time and money on features that aren't beneficial to Chrome. One example of this is the time required to spawn a new V8 context, around 30ms. It could be made drastically faster if all security features were removed from the V8 boot process (not needed for server side trusted execution environments) but Google needs secure VMs for Chrome tabs and it wouldn't make sense for Chrome to spend time optimizing V8 for this use case.
I didn't get the feeling, however, as this article implies, that V8 is a "roadblock" for Node.
- mraleph 15y agoCreating a new V8 Context when V8 is compiled with snapshots is ~2 ms on a decent hardware. But it's still too long for node.js needs: the idea was to create an isolated world per request. Yes, you can spawn a context faster if you strip out the duplication and make Contexts share built-in objects. But then you remove the only important feature Contexts have --- isolation and you don't really need them. [Another important thing here: in the browser each iframe has a different Context. You can't really abandon isolation --- that would lead to spec violation and massive security holes]
- pavlov 15y agoInteresting that creating a context in V8 is so slow. I use JavaScriptCore in a desktop application, and creating a new context using JSGlobalContextCreate() takes something on the order of 1-2 ms on a MacBook -- anyway small enough that I don't need to care about starting lots of contexts. V8 is a great technical achievement, but sometimes I wonder if its reputation as "the fast JS runtime" isn't more due to Google's excellent Chrome marketing (remember the Scott McCloud comic?) than actual measurements. JavaScriptCore is no slouch either, and is easy to integrate into applications with its plain-C API.
- mamp 15y agoThe main item I seem to recall Ryan Dahl and others commenting on was V8's garbage collection which is pretty laze because web pages don't stay open for long periods of time. Obviously this is different on the server. If true, that's pretty deep change inside V8 required for Node.
- mraleph 15y agoThere are a public issue tracker and v8-users mailing list. If somebody is experiencing problems with GC then they should stop by and ask or file an issue or submit a benchmark/testcase...