diff options
| author | Darshan Sen <raisinten@gmail.com> | 2023-01-03 16:06:25 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-03 10:36:25 +0000 |
| commit | e35e893d2651a8f2995695085aa85fd9f53e15e4 (patch) | |
| tree | 867a81b0ca30a6adcebd8cffacd4e3743ce43e8b /src/env.h | |
| parent | 6d49f46b48be969befff98bf5b38339df3c06c19 (diff) | |
| download | node-new-e35e893d2651a8f2995695085aa85fd9f53e15e4.tar.gz | |
src: speed up process.getActiveResourcesInfo()
This change reduces the number of calls that were crossing the JS-C++
boundary to 1 and also removes the need for calling Array::New()
multiple times internally and ArrayPrototypeConcat-ing the results
later on, thus improving performance.
Refs: https://github.com/nodejs/node/pull/44445#pullrequestreview-1220052837
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46014
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'src/env.h')
| -rw-r--r-- | src/env.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -465,6 +465,7 @@ struct EnvSerializeInfo { AsyncHooks::SerializeInfo async_hooks; TickInfo::SerializeInfo tick_info; ImmediateInfo::SerializeInfo immediate_info; + AliasedBufferIndex timeout_info; performance::PerformanceState::SerializeInfo performance_state; AliasedBufferIndex exit_info; AliasedBufferIndex stream_base_state; @@ -676,6 +677,7 @@ class Environment : public MemoryRetainer { inline AsyncHooks* async_hooks(); inline ImmediateInfo* immediate_info(); + inline AliasedInt32Array& timeout_info(); inline TickInfo* tick_info(); inline uint64_t timer_base() const; inline std::shared_ptr<KVStore> env_vars(); @@ -1007,6 +1009,7 @@ class Environment : public MemoryRetainer { AsyncHooks async_hooks_; ImmediateInfo immediate_info_; + AliasedInt32Array timeout_info_; TickInfo tick_info_; const uint64_t timer_base_; std::shared_ptr<KVStore> env_vars_; |
