-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add a profile script #475
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
Add a profile script #475
Conversation
var originalConsole = console; | ||
var consoleLog = originalConsole.log; | ||
|
||
// Our usage of globals to store setTimeout/clearTimeout upsets iron-node for some reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an issue on iron-node
about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Can you quickly mention how to use this in |
Can you add a |
Tried it now. What's the workflow for profiling? The tests run on startup and finish before I manage to do anything. Is the recommended practise to put a |
Sorry @sindresorhus - for some reason I never got notifications on any of these.
Click record then reload the page (that is what I did). I did not put any debugger statements in. That's an interesting thought though. |
082e774
to
946fec3
Compare
Awesome. Excited to have an easy way to perf test AVA. |
I find this very intersting! Are you willing to share your workflow to profile your software in something like markdown documentation? I like to link from my repo to share your work with the community. Just want to say... keep in mind that results might differ from native node but it will in fact deliver insightful results. |
@s-a I added a short section in https://github.com/sindresorhus/ava/blob/master/maintaining.md#profiling. Was hoping @jamestalmage would fill it out with his workflow. |
👍 I can not wait to read it . :) @jamestalmage Please ping me here when you finished. |
I'm also interested in the progress of this thread and how we can combine efforts with devtool to provide better debugging/profiling all around. e.g. The Relevant commit: |
Relevant: https://github.com/Jam3/devtool#iron-node @mattdesl Is there anything |
I just played with
@mattdesl @s-a, with either project, is there a way to tell Chrome DevTools to start recording a CPU profile programmatically? It would be awesome not to have to start the recording and then reload the page. |
@jamestalmage |
I think the differences will be subtle between the two tools, though my end goal is to have You can use I am currently writing a blog post on all things |
@jamestalmage sorry #491 is out of my scope. I feel this could have something to do with
As matt metioned in his README.md devTool is in an experimental state.
However FYI just added https://github.com/s-a/iron-node/blob/master/docs/PROFILE.md. There is a lot more work todo. :) Nice weekend @ALL 😄 |
I've been working on getting
iron-node
working with AVA so we can do some proper profiling. I think I finally cracked it.The first thing was to run in a single process (this means only running a single test file), and fake the response of a parent process. It logs test results to the Chrome DevTools console (and it's not very pretty), but we shouldn't really care about the test results much while profiling.
The second was working around some weirdness with
setTimeout
iniron-node
. I'm not sure if it's aniron-node
problem, or anelectron
one, but storingsetTimeout
the way we do inglobals.js
breaks things. The solution here was to just undo our safe copies ofsetTimeout
andclearTimeout
. This means we can't profile against anything that manipulates timers (not sure why that would ever be necessary).