mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-25 18:37:19 +00:00
[all] Change the default high water mark to 64k (#1255)
The 16k water mark was set a long time ago, 64k is the default for `fs.ReadStream` You should experiment with your application and baudrate. We also now allocate a buffer pool during object initialization because 99% of the time we'll be doing during runtime and why not take the perf hit upfront instead on first byte. A side note: The source behind `Buffer.poolSize` and how buffers are allocated and the `ReadStream`'s `BufferList` are fascinating reads. It's obvious a lot of work has gone into these systems.
This commit is contained in:
parent
470afbcae6
commit
f69407dc6a
1 changed files with 2 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ const defaultSettings = Object.freeze({
|
|||
xany: false,
|
||||
xoff: false,
|
||||
xon: false,
|
||||
highWaterMark: 16 * 1024
|
||||
highWaterMark: 64 * 1024
|
||||
});
|
||||
|
||||
const defaultSetFlags = Object.freeze({
|
||||
|
|
@ -166,7 +166,7 @@ function SerialPort(path, options, callback) {
|
|||
|
||||
this.opening = false;
|
||||
this.closing = false;
|
||||
this._pool = null;
|
||||
this._pool = allocNewReadPool(this.settings.highWaterMark);
|
||||
this._kMinPoolSpace = 128;
|
||||
|
||||
if (this.settings.autoOpen) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue