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

Speed up requiring index.js file #249

Merged

Conversation

bertdeblock
Copy link
Contributor

@bertdeblock bertdeblock commented Feb 7, 2023

Ember CLI requires every addon's index.js file when running any command.
I noticed that requiring ember-svg-jar's index.js file takes a bit of time.
This PR should speed things up a bit by only requiring some packages when they are actually used.

Before: 170-180ms
After: 25-30ms

Tested on an Apple M1 Pro MacBook using:

console.time('require');
require('./index.js');
console.timeEnd('require');

@evoactivity
Copy link
Owner

evoactivity commented Jul 11, 2023

I like the look of this, quite a significant speed improvement.

I've been given write access and npm access today but I've just released 2.4.3 so not going to merge this right away but it's on my radar to merge in with next release.

@bertdeblock
Copy link
Contributor Author

Thanks @evoactivity!

@evoactivity evoactivity merged commit c759d8f into evoactivity:master Aug 1, 2023
@evoactivity
Copy link
Owner

This has been merged and released into 2.4.4

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

Successfully merging this pull request may close these issues.

None yet

2 participants