Skip to content
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

fs: move type checking for multiple fs methods to js #17334

Closed
wants to merge 10 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Nov 27, 2017

Update errors to use internal/errors, move type checking

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

@jasnell jasnell added errors Issues and PRs related to JavaScript errors originated in Node.js core. fs Issues and PRs related to the fs subsystem / file system. semver-major PRs that contain breaking changes and should be released in the next major version. labels Nov 27, 2017
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Nov 27, 2017
Copy link
Member

@TimothyGu TimothyGu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I'd like a CITGM run though.

Copy link
Contributor

@maclover7 maclover7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm happy to try and tackle it, but it'd be great to try and DRY up some of the validation checks, most seem somewhat similar.

@mscdex
Copy link
Contributor

mscdex commented Nov 27, 2017

How does this affect performance?

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if benchmarks are good

}

const int64_t len = len_v->IntegerValue();
const int64_t len = args[1]->IntegerValue();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something something deprecated overload ;)

@jasnell
Copy link
Member Author

jasnell commented Nov 27, 2017

Looking just at fs.fstat, the impact is minimal in the microbenchmarks.

$ ./node benchmark/compare.js --old node --new ./node --filter stat fs > ~/fsbench
[00:32:12|% 100| 2/2 files | 60/60 runs | 3/3 configs]: Done
 james@ubuntu:~/node/node$ cat ~/fsbench | Rscript benchmark/compare.R
                                                         improvement confidence     p.value
 fs/bench-stat.js statType="fstat" n=200000                  -8.78 %            0.489611332
 fs/bench-stat.js statType="lstat" n=200000                  16.78 %          * 0.039583545
 fs/bench-stat.js statType="stat" n=200000                   10.82 %            0.145232808
 fs/bench-statSync.js statSyncType="fstatSync" n=1000000     -2.82 %         ** 0.005483922
 fs/bench-statSync.js statSyncType="lstatSync" n=1000000     -5.78 %         ** 0.001044621
 fs/bench-statSync.js statSyncType="statSync" n=1000000      -1.83 %            0.437744271

(comparing with 9.2.0)

@jasnell jasnell force-pushed the fs-migrate-internal-errors branch from 88f7a36 to 458ab44 Compare November 27, 2017 04:51
The type is already checked in JS. Change to a CHECK
@jasnell
Copy link
Member Author

jasnell commented Nov 27, 2017

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but it needs a CITGM run.

@jasnell
Copy link
Member Author

jasnell commented Dec 13, 2017

@jasnell
Copy link
Member Author

jasnell commented Dec 13, 2017

Unrelated failures in Linux CI but running again there just to be safe: https://ci.nodejs.org/job/node-test-commit-linux/14937/

jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell added a commit that referenced this pull request Dec 13, 2017
The type is already checked in JS. Change to a CHECK

PR-URL: #17334
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Dec 13, 2017

Landed in 04ae486...805dca1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core. fs Issues and PRs related to the fs subsystem / file system. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants