On Wed, Apr 11, 2012 at 17:22, Satyam Shekhar <satyamshek...@gmail.com> wrote:
> Hmm.. So here is another question just to pester you more. :)..
>
> Lets suppose a function in my app(iin JS) has this code:
>
> var cpp_binding = require('./cpp-binding');
> function js_fn() {
>    cpp_binding.execute();
> }
>
> Now when the profiler wakes up it sees an instruction in execute fn (in
> cpp_binding) being executed(lets assume it consumes a lot of ticks). Now,
> where would these ticks counted? Will they appear in JS section -- right at
> the top? or will they _only_ appear in C++ section?
>
> Also, in the profiler output I sent I dont have any ticks in C++ section,
> however I m using bindings (node-expat, compress-buffer).
> Why could have that happened?

Modules are loaded with dlopen(). I don't think the V8 profiler
handles that, time spent in them will be counted towards the main node
binary.

>> Unaccounted ticks? For a variety of reasons. For example, glibc
>> generates trampolines (executable on-stack code) that confuse the
>> profiler no end.
>
> Oh ok.. is it safe to say these are due to C++ bindings or some code in V8..

Yes, it is.

>> Here's a GSoC project for you: augment callgrind to understand the
>> code V8 generates. I'll buy you a beer if you do. :-)
>
> You know, I d actually be interested in such projects. Can you point me to
> some essential/good readings for V8 from where I can understand it much
> better. :)

I don't think you'll find a better resource than the source itself.
It's pretty massive though: 635,000 lines of code and counting.

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to