New issue
Advanced search Search tips

Issue 631907 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Aug 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

The result of profile is confusing.

Reported by slaye...@gmail.com, Jul 27 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36

Steps to reproduce the problem:
1. Function A calls function B (A -> B), and the profile shows function B takes a long time (e.g 50s).
2. Because I want to know which part of the function B takes the most time, I split the large function into small parts: B, C, D. (A -> B -> C -> D)
3. Profile shows the small functions together take a very very short time, but their parent takes a long time. (B + C + D: 0s, A: 50s)

What is the expected behavior?
When a large function is split into small functions, the small functions should take no shorter time than the origin function in profile.

What went wrong?
Profile shows the small functions together take a very very short time, but their parent takes a long time. (B + C + D: 0s, A: 50s)

Did this work before? N/A 

Chrome version: 52.0.2743.82  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 22.0 r0

Any recommend to find out which part of a function is most time-consuming?
 
before_split_function_wm.png
328 KB View Download
after_split_function_wm.PNG
334 KB View Download

Comment 1 by slaye...@gmail.com, Jul 27 2016

I've tried writing some simple cases to reproduce this issue. But it seems cannot be reproduced by simple cases.
Owner: alph@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 3 by alph@chromium.org, Jul 30 2016

Labels: Needs-Feedback
My guess is that it could be caused by inlining. Once you made findSegsNearArea small enough V8 inlined it into its caller. Currently profiler cannot tell if the long running code was originated from inlined function.

I'm wondering why you need to split the function. Doesn't line level profile work for you? If you open the source code for the function it should annotate lines with the execution time.

Comment 4 by slaye...@gmail.com, Aug 2 2016

Thank you for your reply. I think your guess makes sense, I'll try to let V8 not inline the functions .

I want to split the function findSegsNearArea because it's long and has several loop statements. I want to know how much time each part costs/ which loop statement is the most time-consuming to optimizing it.

Thank you very much.

Comment 5 by alph@chromium.org, Aug 2 2016

The line level profile is exactly the tool that helps you track down where the time spent in a long function. Have you tried it?

Comment 6 by alph@chromium.org, Aug 22 2016

Status: WontFix (was: Assigned)
I'm closing it for now as it seems to work as intended.

Sign in to add a comment