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

add local eslint rule rule for banning concat and new performance test #690

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Connum
Copy link
Contributor

@Connum Connum commented Mar 22, 2024

Description

This adds a test for #683 as well as a new local eslint rule for banning concat(). In favour of push(...).
It also refactors all instances of concat() throughout the code base, so we should wait for several other outstanding PRs before merging this, in order to avoid a mass of conflicts. This PR is also blocked by #683 because it depends on it.

Motivation and Context

#513 and #683 show a clear performance improvement especially for larger/more complex fonts.

How Has This Been Tested?

Made sure the tests are all still passing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • performance improvement

Checklist:

  • I did npm run test and all tests passed green (including code styling checks).
  • I have added tests to cover my changes.
  • My change requires a change to the documentation.
  • I have updated the README accordingly.
  • I have read the CONTRIBUTING document.

@Connum
Copy link
Contributor Author

Connum commented Mar 22, 2024

The spread operator is quite slow as well. Used with a single push() call, it's still considerably slower than using multiple for() loops. See https://jsperf.app/cabimi

TODO: use this optimization in the refactored code as well

@Connum Connum marked this pull request as draft March 22, 2024 16:42
@Connum Connum mentioned this pull request Mar 24, 2024
8 tasks
@Connum Connum added the dev Changes revolving merely around dev-related code like testing, build process, etc. label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Changes revolving merely around dev-related code like testing, build process, etc. performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants