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

Minor performance optimizations for dictionary import #412

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

Casheeew
Copy link
Member

Reimplements _getArchiveFiles so that its only run once.
This change allows you to break early if you found the match, avoiding having to cycle through the entire fileMap for each file type.
For a dictionary with mostly files of term_bank_?.json format (most dictionaries), the time is improved to O(n) instead of O(n*m).

@Casheeew Casheeew requested a review from a team as a code owner December 21, 2023 03:41
Copy link

github-actions bot commented Dec 21, 2023

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

Copy link
Collaborator

@djahandarie djahandarie left a comment

Choose a reason for hiding this comment

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

Nice, thanks! Did you notice any speed difference on the really big dict imports (wikipedia, pixiv, etc.)? We really need a benchmark suite...

@djahandarie djahandarie added this pull request to the merge queue Dec 21, 2023
Merged via the queue into yomidevs:master with commit b83ca2f Dec 21, 2023
5 checks passed
@Casheeew Casheeew deleted the development-optimization branch December 21, 2023 14:37
@Casheeew
Copy link
Member Author

Casheeew commented Dec 21, 2023

Nice, thanks! Did you notice any speed difference on the really big dict imports (wikipedia, pixiv, etc.)? We really need a benchmark suite...

I did try to compare performance but its not very reliable. Also this doesn't deal directly with the importing step to IndexedDB, so there will probably only be a minor improvement.

@djahandarie djahandarie added the kind/enhancement The issue or PR is a new feature or request label Dec 21, 2023
@djahandarie djahandarie changed the title Minor optimizations for dictionary import Minor performance optimizations for dictionary import Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants