GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — util: delay creation of debug context by ofrobots · Pull Request #2248 · nodejs/node Conversation
Contributor
Now that it is really simple to take profiles with node (thanks to #2090), I was looking a profile I got from a trivial I was really surprised by the number of ticks I got in I looked into this. It seems that #1471 introduced a change which now creates a Debug context by default in the util module. This is needed to be able to inspect promises. I think this is fine, but we should not be doing the really expensive operation of creating a Debug context on default startup of node. This patch fixes that. Based on my measurements, this saves ~24ms in node startup time measured as follows: #!/usr/bin/bash # Note: this requires GNU date start=$(date +%s%N) for c in {0..60} do iojs -e " " done new=$(date +%s%N) elapsed=$(((new - start)/60)) echo $elapsed This reduces startup time from ~90ms → ~66ms on my machine. I think it is important that node startup is as fast as possible. I don't like deferred initialization as I am proposing, but I think it is a much lesser evil than spending 24ms on each node startup.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsWe need the debug context to be able to inspect promises. However, this is very expensive and should not be done on default startup.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ofrobots
added a commit
that referenced
this pull request
We need the debug context to be able to inspect promises. However, this is very expensive and should not be done on default startup. PR-URL: #2248 Reviewed-By: Brian White <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Christopher Monsanto <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |