I've been profiling my code and the most expensive function reported
is the C++ function _chmod. It appears about 4 times as often as my
most expensive Javascript function.
My program doesn't use the filesystem. It's very simple. It prints
one line to the console and only has 2 "require" calls that aren't my
code: underscore, and EventEmitter2 (require("events") exhibits the
same problem).
I've done some grepping through node and its dependencies, and I'm
scratching my head. _chmod is apparently called by many functions and
I don't see anything in common between them.
Is this an internal node.js thing? Is it anything to be concerned
about or is there anything I can do to prevent it? Any insight would
be greatly appreciated.
Thanks!
Example:
499 8.8% _chmod
69 13.8% LazyCompile: *Player.draw /my/project/path/
player.js:192
38 55.1% Function: Player.doCleanup /my/project/path/
player.js:119
36 94.7% LazyCompile: *Player.doPlay /my/project/path/
player.js:99
36 100.0% LazyCompile: *Player.onPlayChosen /my/project/
path/player.js:168
36 100.0% LazyCompile: *EventEmitter.emit /my/project/
path/node_modules/eventemitter2/lib/eventemitter2.js:242
Player.draw /my/project/path/player.js:192 is as follows
Player.prototype.draw = function(n) {
var card, drawn, _i, _len;
drawn = this.take(n);
for (_i = 0, _len = drawn.length; _i < _len; _i++) {
card = drawn[_i];
this.hand[card.id] = card;
}
return drawn;
};
this.take(n) returns an array. this.hand is an object initialized
using curly brackets. card.id is an integer.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en