[nodejs] How to profile for high CPU utilization?

2013-03-08 Thread cpprototypes
Due to node's single thread execution, high CPU tasks should be offloaded to a queue for other processes to process. However, is there any easy way to figure out how long a section of code is taking? I could do the brute force way of putting in a bunch of start = current time, end = end time,

[nodejs] V8 team will start working on generators

2013-03-28 Thread cpprototypes
Source: http://code.google.com/p/v8/issues/detail?id=2355 I think generators have the potential to greatly change how node.js code is written (for example it could look like this http://taskjs.org). However, it depends on many factors: 1) How easy will it be to migrate existing node.js code?

[nodejs] ECMAScript 6, asm.js, can node.js dump V8 or be VM agnostic?

2013-04-03 Thread cpprototypes
I was recently excited to find out that V8 is starting work on adding generators support. Then I heard about asm.js and looked into Firefox's *Monkey (OdinMonkey, SpiderMonkey, etc.) series of JS engines. Performance is good, they've already implemented many ECMAScript 6 features, and now asm

[nodejs] Weird error with generators (using suspend or galaxy)

2013-07-12 Thread cpprototypes
I'm using node 0.11.3 with --harmony-generators to try the new feature. I found two libraries that should help use existing node callback-based code with generators (suspend and galaxy). The code I'm trying to run was similar to the following: (using suspend) var fs = require('fs'); var requ

[nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-15 Thread cpprototypes
e than just network async programming. On Friday, July 12, 2013 2:47:28 PM UTC-7, cpprototypes wrote: > > I'm using node 0.11.3 with --harmony-generators to try the new feature. I > found two libraries that should help use existing node callback-based code > with generators (susp

[nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-15 Thread cpprototypes
UTC-7, cpprototypes wrote: > > I'm using node 0.11.3 with --harmony-generators to try the new feature. I > found two libraries that should help use existing node callback-based code > with generators (suspend and galaxy). The code I'm trying to run was > similar to

[nodejs] Is a NODE_MAX_PROCS possible? multithread the event loop?

2014-03-22 Thread cpprototypes
The core of node.js is a single threaded event loop. Events get pushed onto a queue and the event loop thread pops off events for processing. Is it theoretically possible for the event loop itself to be multithreaded? There's already a queue of things ready to be processed. What if there we