From a2c82c386b433786f5f579dd3febfce7571e17a9 Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Wed, 22 Nov 2017 10:03:17 -0500 Subject: [PATCH] doc: non-partitioned async crypto operations Neither crypto.randomBytes nor crypto.randomFill partitions the work submitted to the threadpool. This change was suggested during the discussion of #17054. See also #17154. PR-URL: https://github.com/nodejs/node/pull/17250 Refs: https://github.com/nodejs/node/pull/17154 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas Reviewed-By: Anna Henningsen --- doc/api/crypto.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 0cbf4e35db27f9..bf92d08d6fc6ee 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1748,6 +1748,11 @@ Note that this API uses libuv's threadpool, which can have surprising and negative performance implications for some applications, see the [`UV_THREADPOOL_SIZE`][] documentation for more information. +*Note*: The asynchronous version of `crypto.randomBytes()` is carried out +in a single threadpool request. To minimize threadpool task length variation, +partition large `randomBytes` requests when doing so as part of fulfilling a +client request. + ### crypto.randomFillSync(buffer[, offset][, size])