Repository navigation
RFC: bundle tick processor with iojs #158
Description
Activity
would be good if bundled processor is able to consume version different from processor's associated distribution. (Someone email me v8.log, or node version on server that produced log is not the version I have on dev machine) - via command line switch ( for example,
--log-version), auto-detect, or using version tag in log file once we start to put itanother requirement (that's what processor shipped with v8 doesn't do) - don't buffer entire log file and process it as a stream. few minutes of profiling can easily generate gigabytes of v8.log
@bnoordhuis I don't think there's any distros left that aims to decouple V8 (node/io.js would just be one example package). It's neigh impossible since every binary linking to it usually expects a different version. Since V8 might not be the best example of a consistent ABI, the effort to keep these versions apart is pretty painful. What I've seen done though is building it separately from the ordinary build in order to manage the environment (PaX-marking, specific stuff for arm, etc). I'll go through a few package managers and see if I can find any that still decouples it.
As for the npm analogy, I'd say that the primary use for
--without-npmis not about avoiding to use it, rather having better control of the npm installation. I agree with--without-ioprofbeing pointless.would be good if bundled processor is able to consume version different from processor's associated distribution. (Someone email me v8.log, or node version on server that produced log is not the version I have on dev machine) - via command line switch ( for example, --log-version ), auto-detect, or using version tag in log file once we start to put it
That doesn't really work and probably never will, at least not for C/C++ symbols. A lesser issue is that every tick processor version adds about 60 kB, unless you get creative with compression; it's not much but it adds up.
It would make for a nice feature once those issues have been worked out but I think it's out of scope for now.
I don't think there's any distros left that aims to decouple V8
I think Fedora still does; its v8 package is shared between nodejs, mongodb and a few more.
@bnoordhuis You're right - didn't know that. Seems like they try to pinpoint minor versions. I think their mongodb package illustrates the issues rather well though; they require 3.14+ while upstream recommends either 3.12.x or 3.25.x. It's really tricky and the test suites for packages (node, mongodb, rethinkdb, etc) wouldn't be reliable enough to verify that whatever version [of v8] you have installed is working as intended. Building and using v8 as a shared library is a very fragile situation. When I used to maintain it, build errors were the "best" way of knowing if you had a problem.
+1
@bnoordhuis @rvagg perhaps this issue can be discussed in your next TC meeting on Dec 17th?
I'm +1 on this & adding a section to the docs explaining how (and when) to use the profiler.
Something to keep in mind re:
--without-ioprof-- some package distributions (EPEL comes to mind) rely on being able to split out the dependencies of node into separate packages. I imagine they'd be grateful if we gave them the tools to continue doing that. This is a bit of a foggy concern since I'm not entirely sure what would go into baking ioprof into the executable would involve.Agreement from TC in today's meeting that this is fine to add. The only cause for concern was in setting a precedent for adding minor functionality like this but it was agreed that this is a special case.
Sorry, TC minutes are in #178
Thanks for doing this. This have always been a major problem when teaching people to solve performance problems.
@bnoordhuis is this still something that is happening?
Yes, once I get the quirks (they're not really bugs) ironed out.
+1 on this. the tick processor is intimately tied to internal details of node's v8, so makes an excellent candidate for distribution with node, and I have had poor luck with the the npmjs.org module that is supposed to build it.
5 remaining items
@Andre-487 v8-profiler doesn't profile C++ code. Or rather, it does but it dumps it all in one big bucket named
(program)(IIRC.)@bnoordhuis iwith debug symbols and
nminstalled it gives you C++ profile as well ( or used to, need to check ) - https://gist.github.com/sidorares/9521922#file-with-nm-txt-L12@sidorares I mean v8-profiler, not node-tick.
@bnoordhuis I thought it's based on the same V8 scripts as node-tick
To be clear, I'm talking about this module: https://github.com/node-inspector/v8-profiler :-)
It uses the C++ API to programmatically start and stop the profiler. The returned profile does not have detailed information for C++ stack frames like
--prof+ linux-tick-processor + nm has.@sidorares Is there any working way to analyze v8.log visually (i.e. with about://tracing or via exporting to .cpuprofile)
Looks like I was wrong.
I try to profile this script with Node 0.10.37 on the Max OS X 10.10:
node --prof sorting.js. node-tick shows this result: http://pastebin.com/8Xmva4xz Looks like correct profile.But on the 0.12.0 it shows this: http://pastebin.com/JVZrQDsY There is no 80% time in system libraries in profile: http://pastebin.com/ZSXekRpg, but 11% in node is questionable.
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Jun 16, 2015 Closing this for now. I have semi-working code sitting in a branch but it needs some V8 fixes that I don't have time for right now.
FWIW, we are looking at making the V8 tick processor directly usable using node. See https://codereview.chromium.org/1179173009/
/cc @matthewloring
@ofrobots Looks great. Thanks for letting us know.
- added a commit that references this issue
on Apr 6, 2017
See bnoordhuis/node-profiler#11 for background. A recurring issue with CPU profiling with
--profis that you either need to build d8 (the V8 shell) or install a tick processor package from npm.The problem with building d8 is that it's quite tedious and frequently broken due to the way V8 is bundled. Installing a tick processor is no picnic either; if it doesn't match the V8 version, it produces bogus output. That isn't currently solvable from user land because the output from the profiler doesn't contain version information and heuristics aren't reliable enough. I'm going to prepare a patch that adds version information but that is a tangential issue. (Update: https://codereview.chromium.org/800293002/)
For ease of use, I propose bundling the tick processor with iojs, either as a standalone JS script (working name:
ioprof) or by baking it into the binary. The former would be easiest short-term, the latter offers an arguably nicer user experience. I volunteer to do the work.Design decisions:
--without-ioprofto the configure script, similar to the--without-npmflag? Assertion without hard data to back it up: no one uses--without-npm;--without-ioprofis probably not worth the hassle.--shared-v8is specified. Maybe @jbergstroem can chime in here.