Skip to content

Commit

Permalink
doc: non-partitioned async crypto operations
Browse files Browse the repository at this point in the history
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 <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
davisjam authored and gibfahn committed Dec 20, 2017
1 parent 04732f1 commit 5d1b76c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/api/crypto.md
Expand Up @@ -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])
<!-- YAML
added: v7.10.0
Expand Down Expand Up @@ -1812,6 +1817,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.randomFill()` is carried out
in a single threadpool request. To minimize threadpool task length variation,
partition large `randomFill` requests when doing so as part of fulfilling a
client request.

### crypto.setEngine(engine[, flags])
<!-- YAML
added: v0.11.11
Expand Down

0 comments on commit 5d1b76c

Please sign in to comment.