Skip to content

Commit 0488782

Browse files
davisjamMylesBorins
authored andcommitted
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: #17250 Refs: #17154 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 0443909 commit 0488782

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/api/crypto.md

+10
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,11 @@ Note that this API uses libuv's threadpool, which can have surprising and
18261826
negative performance implications for some applications, see the
18271827
[`UV_THREADPOOL_SIZE`][] documentation for more information.
18281828

1829+
*Note*: The asynchronous version of `crypto.randomBytes()` is carried out
1830+
in a single threadpool request. To minimize threadpool task length variation,
1831+
partition large `randomBytes` requests when doing so as part of fulfilling a
1832+
client request.
1833+
18291834
### crypto.randomFillSync(buffer[, offset][, size])
18301835
<!-- YAML
18311836
added: v7.10.0
@@ -1933,6 +1938,11 @@ Note that this API uses libuv's threadpool, which can have surprising and
19331938
negative performance implications for some applications, see the
19341939
[`UV_THREADPOOL_SIZE`][] documentation for more information.
19351940

1941+
*Note*: The asynchronous version of `crypto.randomFill()` is carried out
1942+
in a single threadpool request. To minimize threadpool task length variation,
1943+
partition large `randomFill` requests when doing so as part of fulfilling a
1944+
client request.
1945+
19361946
### crypto.setEngine(engine[, flags])
19371947
<!-- YAML
19381948
added: v0.11.11

0 commit comments

Comments
 (0)