-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib,src: split up big builtin scripts #2714
Conversation
Reduces the body of parsed source code from 210 kb to 80 kb for a null program (`node -e 0`) and from 255 kb to 190 kb for a one-liner that prints some output to the console. It doesn't seem to have much impact on the size of the generated code (on my system I see an 8% reduction with --nolazy and 3% without) but hopefully it speeds up startup on slow systems because there is now less source code to parse.
Looks like this PR is affected by the issue with 617ee32. |
@cjihrig All the PRs that were published (or rebased) in the last few days need to be rebased now. |
517062d
to
42e9c45
Compare
Ah, it wasn't like that when I opened the PR this morning. Anyway, rebased and new CI started: https://ci.nodejs.org/job/node-test-pull-request/256/ |
const Buffer = require('buffer').Buffer; | ||
const util = require('util'); | ||
const debug = util.debuglog('stream'); | ||
const EE = require('events').EventEmitter; |
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.
EventEmitter
at the end could be removed along with this change I guess.
@bnoordhuis npm 2.14.2 has graceful-fs ~4.1.2 as its dependency. That has the fix which you proposed. |
@bnoordhuis could you send me some |
@Fishrock123 E.g. here:
|
I guess the problem is that npm and node-gyp depend on different versions of graceful-fs.... |
@thefourtheye Thanks for filing that node-gyp pull request but I don't think that's going to be enough, there's a whole bunch of npm dependencies that depend on outdated versions of graceful-fs:
|
@bnoordhuis I'll submit a patch to those packages now. But then even if they upgrade, we can land this only after npm picks up the upgraded dependencies, right? |
Yes, that's right. |
Just so everyone is clear, even were we to land all those PRs today (which we're not going to do, because this is the middle of a long holiday weekend in the US, and also those changes need to go through our release process, and probably, y,know, be tested), it's at least two Thursdays until the patched version of npm would be ready for downstream use. This strongly argues against including this PR in Node 4.0.0, unless everyone is cool with waiting that long. Big thanks to @thefourtheye for taking the time to put those PRs together. |
As mentioned in the PR,
we can assume that it may not be targeted for 4.0.0 (@bnoordhuis please correct if I am wrong).
You are welcome 😊 |
Nope, that's right; I wasn't planning on landing this in v4.x. |
const debug = require('internal/debuglog')('stream'); | ||
const inherits = require('internal/inherits'); | ||
|
||
var Duplex; // Break recursive dependency with _stream_duplex.js. |
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.
This seems like it should be unnecessary, since _stream_duplex
's export is hoisted.
@Trott You know you can make a new label if you need to right? :) |
graceful-fs used to monkey-patch node's core fs module. This has been fixed in the version 4. Related: nodejs/node#2714 PR-URL: #3
graceful-fs used to monkey-patch node's core fs module. This has been fixed in the version 4. Related: nodejs/node#2714 PR-URL: #4
graceful-fs used to monkey-patch node's core fs module. This has been fixed in the version 4. Related: nodejs/node#2714 PR-URL: #64
In |
@bnoordhuis npm now ships with all those patches by default, so the above concerns seem to be met now. |
@bnoordhuis is this still a thing you'd like to do? |
Closing, stale. Now that it's possible to add our own code to the snapshot, that's probably a better solution anyway. |
Reduces the body of parsed source code from 210 kb to 80 kb for a null
program (
node -e 0
) and from 255 kb to 190 kb for a one-liner thatprints some output to the console.
It doesn't seem to have much impact on the size of the generated code
(on my system I see an 8% reduction with --nolazy and 3% without) but
hopefully it speeds up startup on slow systems because there is now
less source code to parse.
Do not merge yet; this is an experiment and for soliciting feedback.
See #2138.
CI: https://ci.nodejs.org/job/node-test-pull-request/255/