Skip to content

perf(mdc-chips): Use class for MDC adapter #19981

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

Closed
wants to merge 13 commits into from

Conversation

ngwattcos
Copy link
Contributor

@ngwattcos ngwattcos commented Jul 15, 2020

Convert the adapters in chips, chip-set, chip-listbox, mat-chipset to class objects to hopefully reduce memory usage.

Test failures hopefully should be resolved after this PR is merged:
material-components/material-components-web#6256

ngwattcos added 2 commits July 9, 2020 12:24
This change replaces the private adapter wth an adapter class object which should hopefully reduce memory usage.
Makes the adapter into a class in MatChipSet and MatChipListbox to hopefully improve memory usage.
@ngwattcos ngwattcos requested a review from mmalerba as a code owner July 15, 2020 03:11
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 15, 2020
Updates chip adapter into a class object to reduce memory usage
@@ -373,6 +389,11 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
this._chipFoundation.destroy();
}

/** Returns the directionality */
getDir() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just make _dir public instead (leave the underscore in the name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got another comment saying to use a method unless it's readonly in a separate PR:
#19985 (comment)

Perhaps the best way is to append an underscore so the method name is _getDir() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: exposed _dir and made it readonly

@mmalerba mmalerba changed the title Optimize chip perf(mdc-chips): Use class for MDC adapter Jul 23, 2020
@mmalerba
Copy link
Contributor

mmalerba commented Aug 3, 2020

Code looks good, but there's some lint and test failures

@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
@andrewseguin
Copy link
Contributor

Closing due to inactivity

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants