lib: make navigator properties lazy · nodejs/node@0f146aa · GitHub
Skip to content

Commit 0f146aa

Browse files
jasnelladuh95
authored andcommitted
lib: make navigator properties lazy
Noticed in some benchmarking/profiling that the Navigator object constructor was rather expensive and slow due to initialization of properties during construction. It makes more sense for these to be lazily initialized on first access. PR-URL: #53649 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent e6a1eeb commit 0f146aa

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/internal/navigator.js

Lines changed: 8 additions & 4 deletions

0 commit comments

Comments
 (0)