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

Suggested perf improvement for high-scale icon rendering #6389

Closed
leahand opened this issue Sep 18, 2023 · 0 comments · Fixed by #6393
Closed

Suggested perf improvement for high-scale icon rendering #6389

leahand opened this issue Sep 18, 2023 · 0 comments · Fixed by #6393

Comments

@leahand
Copy link
Contributor

leahand commented Sep 18, 2023

Environment

  • Package version(s): blueprint-core 5.3.0 / blueprint-icons 5.1.6
  • Browser and OS versions: macos / chrome 117.0.5938.88

Feature request

Medium-to-high-scale lists with <Icon /> components in each list item spend a disproportionate amount of time validating icon name validity via IconLoader.isValidIconName. For example, mounting a list of <100 items spends 1-2ms in this validation function alone.

https://github.com/palantir/blueprint/blob/develop/packages/icons/src/iconLoader.ts#L141

It seems like a more efficient storage/memoization of the icon name strings to avoid repeated re-creation of the IconNames.values() array would be a reasonable low-lift FR that could make a notable difference here.

Examples

Screenshot 2023-09-18 at 4 59 14 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants