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

toArrayBuffer (and download) slow due to use of concat function #512

Closed
Balearica opened this issue May 11, 2022 · 2 comments
Closed

toArrayBuffer (and download) slow due to use of concat function #512

Balearica opened this issue May 11, 2022 · 2 comments

Comments

@Balearica
Copy link
Contributor

Saving font files using toArrayBuffer (and functions that invoke it) takes much longer than necessary (several seconds per font on some browser/OS combinations) due use of the concat function to append elements to an array. For example, I ran window.font.download() in the console of the https://opentype.js.org/ site (on Firefox + Windows 10) and 86% of the runtime was due to the concat function. This should be resolved easily by using push instead--I will write a pull request in the next few days.

@Balearica
Copy link
Contributor Author

Added pull request. Interestingly, while this change should improve performance across the board, use of concat only caused extreme runtimes for Firefox (I also tested on Chrome, Edge, and Safari). Not sure why.

@Balearica
Copy link
Contributor Author

Closing as pull request was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant