Skip to content

Commit a2c82c3

Browse files
davisjamgibfahn
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 af7d7a4 commit a2c82c3

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
@@ -1748,6 +1748,11 @@ Note that this API uses libuv's threadpool, which can have surprising and
17481748
negative performance implications for some applications, see the
17491749
[`UV_THREADPOOL_SIZE`][] documentation for more information.
17501750

1751+
*Note*: The asynchronous version of `crypto.randomBytes()` is carried out
1752+
in a single threadpool request. To minimize threadpool task length variation,
1753+
partition large `randomBytes` requests when doing so as part of fulfilling a
1754+
client request.
1755+
17511756
### crypto.randomFillSync(buffer[, offset][, size])
17521757
<!-- YAML
17531758
added: v7.10.0
@@ -1812,6 +1817,11 @@ Note that this API uses libuv's threadpool, which can have surprising and
18121817
negative performance implications for some applications, see the
18131818
[`UV_THREADPOOL_SIZE`][] documentation for more information.
18141819

1820+
*Note*: The asynchronous version of `crypto.randomFill()` is carried out
1821+
in a single threadpool request. To minimize threadpool task length variation,
1822+
partition large `randomFill` requests when doing so as part of fulfilling a
1823+
client request.
1824+
18151825
### crypto.setEngine(engine[, flags])
18161826
<!-- YAML
18171827
added: v0.11.11

0 commit comments

Comments
 (0)