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 addaleax committed Nov 28, 2017
1 parent 645cd19 commit 16e87ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/api/crypto.md
Expand Up @@ -1826,6 +1826,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 @@ -1933,6 +1938,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 16e87ed

Please sign in to comment.