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

Faster card searching #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alextarrell
Copy link

Improved file walking and card lookup performance dramatically, going from ~40s to ~1s for ~500 cards in my own experience.

Removing the call to `fs.statSync` for each file and instead passing the
`withFileTypes` option to `fs.readdirSync` reduces the file read
overhead significantly.
Reduces the amount of string processing going on by caching all the
normalized file names before matching cards to image names.
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

1 participant