-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish (program) and (idle) in the time profiles #38
Comments
We should confirm that |
@nolanmar511 Did we say during the discussion last time that you are going to look at the profiler source code to confirm that (program) only has the (idle) meaning? |
Yes, we did say that -- I do need to look at the source code to confirm that (program) only has the (idle) meaning. Thank you for reminding me of this. |
It does look like the v8 differentiates between "(program)" and "(idle)", given that both strings are defined here and idle and program appear to be used differently here. I've not yet found any precise documentation on what "(program)" includes, but this Stack Overflow question referenced this bug from 2012, which suggests "(program)" (at one point and when using --inspect) referenced a mix of things, including idle time and native code execution. Although there seems to be some concept of "(idle)" in v8-profilers, I've not seen a profile with that string. So, I'm guessing that idle time is encompassed in "(program)", but I'm don't think everything in program is idle. |
Closing this for now. We'll just use the naming the runtime uses, without any modifications. |
Re-opening to take a look and at least document somewhere the exact meaning of (idle) and (program). |
/cc @ofrobots |
notes from discussion: It might be possible to distinguish real idle times vs. Node.js doing stuff – it might worth looking at how Chrome uses SetIdle API from V8 and whether something similar can be done to distinguish |
@ofrobots Any update on this? It might make sense to at least do the simple thing first and make sure that all of the time where the main thread is not executing any JS code is marked as (idle) rather than (program). Reporting everything as (program) doesn't make much sense. |
I started looking at this. It turns out that Node is not reporting true idle times to the VM by default. See nodejs/node#19009 (comment). A real fix for this would be for Node to report these phases by default, but we can work-around this in the meanwhile. WIP PR forthcoming. |
fix: distinguish idle from program time Fixes: #38
@ofrobots @nolanmar511
Currently the time profiles contain a pseudo-node named "(program)" for samples which do not have any active Node.js code running. I find this name misleading. It would be clearer if it would be named "(idle)".
The text was updated successfully, but these errors were encountered: