From 1365f657b51d31044cca54c3152d3940a4bd9dc3 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 21 Oct 2018 08:34:00 +0200 Subject: src: improve StreamBase read throughput Improve performance by providing JS with the raw ingridients for the read data, i.e. an `ArrayBuffer` + offset + length fields, instead of creating `Buffer` instances in C++ land. PR-URL: https://github.com/nodejs/node/pull/23797 Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: James M Snell --- src/env.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/env.h') diff --git a/src/env.h b/src/env.h index 3daa48f9cb..a85058f895 100644 --- a/src/env.h +++ b/src/env.h @@ -668,6 +668,7 @@ class Environment { should_abort_on_uncaught_toggle(); inline AliasedBuffer& trace_category_state(); + inline AliasedBuffer& stream_base_state(); // The necessary API for async_hooks. inline double new_async_id(); @@ -951,6 +952,8 @@ class Environment { AliasedBuffer trace_category_state_; std::unique_ptr trace_state_observer_; + AliasedBuffer stream_base_state_; + std::unique_ptr performance_state_; std::unordered_map performance_marks_; -- cgit v1.2.3