Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Use _private instead of #private properties #1355

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

chriskrycho
Copy link
Contributor

Backport for #1335.

The updates to the template compiler made in support of strict mode
introduced a number of uses of private class fields, some of them in hot
paths. Although all supported versions of Node support private class
fields, `tsc` transpiles private class fields to `WeakMap`s for all
values of `target` lower than `ESNEXT`. As a result, the use of private
class fields results in dramatically higher memory usage and garbage
collection than in the previous version of the template compiler. This
in turn causes at least a large portion of the regression noted in
[emberjs/ember.js#19750][1].

[1]: emberjs/ember.js#19750

Here, we replace *all* private class fields with `_` private fields,
which substantially (thought not 100%) closed the gap with the original.

Co-authored-by: Brenden Palmer <brendenpalmer@gmail.com>
@chriskrycho chriskrycho changed the title Use _private instead of #private properties Backport: Use _private instead of #private properties Oct 22, 2021
@rwjblue rwjblue merged commit 8563072 into glimmerjs:release-0-80 Oct 22, 2021
@chriskrycho chriskrycho deleted the backport-private-fix branch October 22, 2021 16:17
@rwjblue rwjblue added the bug label Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants