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

feat: optimize match currencies #345

Closed
wants to merge 3 commits into from

Conversation

chrisduma-ledger
Copy link

Fix for this ticket

There was a big delay on the loading of live apps(buy, sell) and I have traced it back to this function's execution time. I have sped it up, it is working fine locally now.

Copy link

changeset-bot bot commented May 1, 2024

⚠️ No Changeset found

Latest commit: 8f2889e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wallet-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2024 2:55pm
wallet-api-wallet-api-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2024 2:55pm

@chrisduma-ledger chrisduma-ledger self-assigned this May 1, 2024
@chrisduma-ledger chrisduma-ledger added bug Something isn't working server labels May 1, 2024
Copy link
Collaborator

@Justkant Justkant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a small suggestion

Comment on lines +8 to +10
const matchers = patterns
.filter((pattern) => pattern)
.map((pattern) => picomatch(pattern));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably do both filtering and mapping in one loop

Suggested change
const matchers = patterns
.filter((pattern) => pattern)
.map((pattern) => picomatch(pattern));
const matchers = patterns.reduce((filtered, pattern) => {
if (pattern) {
filtered.push(picomatch(pattern));
}
return filtered;
}, []);

@Justkant
Copy link
Collaborator

Justkant commented May 7, 2024

I'm closing this PR for now, thanks for the work, I'm working on this right now and will provide another version with another fix and without breaking the order of currency.list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants