Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
I'm getting 2 orders of magnitude performance penalty when using field initialiser. See snippet below (corrected after @devsnek comment):
"use strict";classA_field_initialized_in_constructor{constructor(){this.foo=true;}}classB_field_initialized_as_class_property{foo=true;}and the results (using https://www.npmjs.com/package/benchmark):
A_field_initialized_in_constructorx812,776,791ops/sec±0.94%(91runssampled)B_field_initialized_as_class_propertyx5,935,129ops/sec±2.31%(86runssampled)Environment:
> uname -a Darwin Pawels-MBP-3.lan 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64 > node -v v14.3.0Metadata
Metadata
Assignees
Labels
v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.