-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Import bundled Insect in index.js
#322
Conversation
e45b6a9
to
3944a20
Compare
Fantastic 🥳 Thank you so much!
Nice! I need to look this up somewhere (issue tracker, Git log) but I believe I remember that I tried this in the past (remove the |
Oh, I think I understand now. With the changes proposed here, the |
Maybe retarget the PR towards your spago branch? (if that's possible across forks) |
You're welcome. :)
I could certainly do that, but then the PR would be merged into my spago branch. I think we can just wait till my Spago PR is merged, then merge this one when it's ready. |
Fixes sharkdp#310, and provides a start for sharkdp#306. This improves the startup time on my machine significantly. I'll let the benchmark results speak for themselves: Before commit: | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Startup time (insect '1+1')` | 513.9 ± 24.4 | 496.4 | 581.2 | 1.00 | | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Startup time, stdin mode (insect < computations-1.ins)` | 535.5 ± 14.2 | 524.6 | 572.7 | 1.00 | | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Evaluation speed (insect < computations-160.ins)` | 1502.1 ± 42.4 | 1466.2 | 1580.7 | 1.00 | After commit: | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Startup time (insect '1+1')` | 192.4 ± 18.5 | 185.4 | 259.1 | 1.00 | | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Startup time, stdin mode (insect < computations-1.ins)` | 208.1 ± 2.0 | 204.8 | 212.2 | 1.00 | | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `Evaluation speed (insect < computations-160.ins)` | 1153.0 ± 17.6 | 1136.6 | 1198.3 | 1.00 | Also, this commit causes `output` to not be published to NPM, which makes for a much smaller installation size: Insect 5.7.0 on NPM has an unpacked size of 29.2 MBs, but `npm publish --dry-run` with this commit reports 378.8 kB. `.npmignore` was also removed, as the `files` property in `package.json` includes only the files we want, so `.npmignore` does basically nothing. Read https://docs.npmjs.com/cli/v8/configuring-npm/package-json/#files for more information. This commit additionally makes a small modification to `index.js` to make it work with Node 12. Unfortunately, at least one of our dependencies (`clipboardy`) does not support Node 10, so I could not make `index.js` work with Node 10.
3944a20
to
948e218
Compare
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.
Thank you!
Fixes #310, and provides a start for #306.
This improves the startup time on my machine significantly. I'll let the benchmark results speak for themselves:
Before:
Startup time (insect '1+1')
Startup time, stdin mode (insect < computations-1.ins)
Evaluation speed (insect < computations-160.ins)
After:
Startup time (insect '1+1')
Startup time, stdin mode (insect < computations-1.ins)
Evaluation speed (insect < computations-160.ins)
Also, this PR causes
output
to not be published to NPM, which makes for a much smaller installation size: Insect 5.7.0 on NPM has an unpacked size of 29.2 MBs, butnpm publish --dry-run
with this PR reports 378.8 kB..npmignore
was also removed, as thefiles
property inpackage.json
includes only the files we want, so.npmignore
does basically nothing. Read https://docs.npmjs.com/cli/v8/configuring-npm/package-json/#files for more information.This PR additionally makes a small modification to
index.js
to make it work with Node 12. Unfortunately, at least one of our dependencies (clipboardy
) does not support Node 10, so I could not makeindex.js
work with Node 10.