Tracing function optimizations and deoptimizations in embedded v8

36 views
Skip to first unread message

Petar Dobrev

unread,
Apr 6, 2016, 3:57:30 AM4/6/16
to v8-users
Hi!

How would one go about obtaining function optimization and deoptimization info from an application with embedded v8? Something similar to the output that one gets from "--trace-deopt" in Chrome or node.

Are there any resources online that I could consult?

Thanks!

Petar

Ben Noordhuis

unread,
Apr 6, 2016, 5:28:51 AM4/6/16
to v8-users
If you mean a programmatic API, then include/v8-profiler.h is the file
you want. I don't believe there's a way to get optimization info but
you can get the deopt and bailout reasons. (Bailout means a function
has been deoptimized and won't be optimized again.)

Petar Dobrev

unread,
Apr 6, 2016, 12:39:25 PM4/6/16
to v8-u...@googlegroups.com
Thanks Ben!

From what I understand, I can the deoptimization information from CpuProfileNode::GetDeoptInfos(), which in turn I get from running and stopping the profiler (CpuProfiler::StopProfiling()). This works great for me!

Just out of curiosity, is there any way to get that info as it happens, without having to start and stop the profiler?

Thanks again!
Petar


 
--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/cb5uEfEXqJc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Noordhuis

unread,
Apr 6, 2016, 1:16:24 PM4/6/16
to v8-users
On Wed, Apr 6, 2016 at 6:39 PM, Petar Dobrev <pe...@chobolabs.com> wrote:
> On Wed, Apr 6, 2016 at 12:28 PM, Ben Noordhuis <in...@bnoordhuis.nl> wrote:
>>
>> On Wed, Apr 6, 2016 at 9:57 AM, Petar Dobrev <peter....@gmail.com>
>> wrote:
>> > Hi!
>> >
>> > How would one go about obtaining function optimization and
>> > deoptimization
>> > info from an application with embedded v8? Something similar to the
>> > output
>> > that one gets from "--trace-deopt" in Chrome or node.
>> >
>> > Are there any resources online that I could consult?
>>
>> If you mean a programmatic API, then include/v8-profiler.h is the file
>> you want. I don't believe there's a way to get optimization info but
>> you can get the deopt and bailout reasons. (Bailout means a function
>> has been deoptimized and won't be optimized again.)
>>
>
> Thanks Ben!
>
> From what I understand, I can the deoptimization information from
> CpuProfileNode::GetDeoptInfos(), which in turn I get from running and
> stopping the profiler (CpuProfiler::StopProfiling()). This works great for
> me!
>
> Just out of curiosity, is there any way to get that info as it happens,
> without having to start and stop the profiler?
>
> Thanks again!
> Petar

I don't think so, I don't believe it's recorded unless the profiler is active.
Reply all
Reply to author
Forward
0 new messages