-
Type: Task
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: BSON, Performance
Investigation
TextDecoder decode vs Buffer toString.
Buffer.toString performs better on small inputs, textdecoder performs better on large inputs, look into a way of potentially using either or both to improve BSON decoding.
See attached benchmark file
downloaded utf8: 13737 bytes small exmp utf8: 96 bytes large Buffer toString x 13,435 ops/sec ±0.62% (93 runs sampled) large TextDe decode x 25,839 ops/sec ±0.83% (93 runs sampled) small Buffer toString x 1,871,376 ops/sec ±0.54% (96 runs sampled) small TextDe decode x 312,321 ops/sec ±7.32% (49 runs sampled) Fastest is small Buffer toString
- is related to
-
NODE-5861 Optimize short basic latin string parsing in BSON
- Closed
- links to