0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/benchmark/tls
Rusty Conover 8b1efe0306 tls: reduce memory copying and number of BIO buffer allocations
Avoid copying buffers before passing to SSL_write if there
are zero length buffers involved.  Only copy the data when
the buffer has a non zero length.

Send a memory allocation hint to the crypto BIO about how much
memory will likely be needed to be allocated by the next call
to SSL_write.  This makes a single allocation rather than the BIO
allocating a buffer for each 16k TLS segment written.  This
solves a problem with large buffers written over TLS triggering
V8's GC.

PR-URL: https://github.com/nodejs/node/pull/31499
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-28 22:02:21 -08:00
..
convertprotocols.js benchmark: swap var for let in benchmarks 2020-02-13 21:38:00 +01:00
secure-pair.js Revert "benchmark: add test and all options and improve errors" 2020-02-10 22:35:35 +01:00
throughput.js tls: reduce memory copying and number of BIO buffer allocations 2020-02-28 22:02:21 -08:00
tls-connect.js benchmark: swap var for let in benchmarks 2020-02-13 21:38:00 +01:00