From f32cbac1b64d5da01881b3aa1c4b28dccfb046dc Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Mon, 20 Nov 2017 12:40:44 -0500 Subject: [PATCH] doc: fs.readFile is async but not partitioned This change was suggested during the discussion of #17054. --- doc/api/fs.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 5b975202dac4ab..600f6db59bef4e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1897,6 +1897,11 @@ Any specified file descriptor has to support reading. *Note*: If a file descriptor is specified as the `path`, it will not be closed automatically. +*Note*: `fs.readFile()` reads the entire file in a single threadpool request. +To minimize threadpool task length variation, prefer the partitioned APIs +`fs.read()` and `fs.createReadStream()` when reading files as part of +fulfilling a client request. + ## fs.readFileSync(path[, options])