Why my node.js C++ addons so slow after running?

42 views
Skip to first unread message

Kaidi ZHU

unread,
Sep 16, 2014, 6:37:55 AM9/16/14
to nod...@googlegroups.com

This is my C++ addons.


And above is the tester code.

SLOW, I mean not running but after running.

`console.log` can be done quickly but there's a long time before process quit.

For example:

    for(var i = 0; i < 35500; i++) {
        rgb
.push({
            r  
: Number.random(0, 255),
            g  
: Number.random(0, 255),
            b  
: Number.random(0, 255)
       
});
   
}
   
var result = thmclrx.cpp.mindifferGet(rgb);
    console
.log(result);


Change `35500` to a small number, it will soon quit after running the addons. But if you change it to a large number, it will be a long time between `console.log` done and quiting.

`console.log` done means the program inside addons is done!

But why there's still such a long time before quit?!

SOS!
Reply all
Reply to author
Forward
0 new messages