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

improve performance of getIconSize() #10125

Merged
merged 2 commits into from Apr 26, 2024
Merged

Conversation

chris48s
Copy link
Member

@chris48s chris48s commented Apr 26, 2024

I attempted to deploy #9191

This happened

9191-deploy

There's something in that change that has caused a big performance issue.

I haven't really benchmarked this, but my instinct is that loading the whole simple-icons set every time we invoke getIconSize() is at least part of the problem.

This PR moves to doing this once at module load time instead of every time we call the function.

Copy link
Contributor

github-actions bot commented Apr 26, 2024

Warnings
⚠️

This PR modified helper functions in lib/ but not accompanying tests.
That's okay so long as it's refactoring existing code.

Messages
📖 ✨ Thanks for your contribution to Shields, @chris48s!

Generated by 🚫 dangerJS against 7be13d4

Copy link
Contributor

🚀 Updated review app: https://pr-10125-badges-shields.fly.dev

Copy link
Contributor

🚀 Updated review app: https://pr-10125-badges-shields.fly.dev

@chris48s chris48s changed the title wip improve performance of getIconSize() Apr 26, 2024
@chris48s chris48s added the core Server, BaseService, GitHub auth label Apr 26, 2024
@chris48s chris48s merged commit 46ed6f0 into badges:master Apr 26, 2024
25 checks passed
@chris48s
Copy link
Member Author

that appears to have done the job 😌

@LitoMore
Copy link
Contributor

I can't believe I made such trouble... 😓

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

Successfully merging this pull request may close these issues.

None yet

2 participants