Skip to content

Improve performance a lot - #1

Open
ariasuni wants to merge 1 commit into
baskerville:masterfrom
ariasuni:improve-performance
Open

Improve performance a lot#1
ariasuni wants to merge 1 commit into
baskerville:masterfrom
ariasuni:improve-performance

Conversation

@ariasuni

@ariasuni ariasuni commented Oct 10, 2023

Copy link
Copy Markdown
  • Smarter use of buffers
  • Read and write to file instead of standard input and output

Benchmarks on my computer on https://github.com/BoboTiG/ebook-reader-dict/releases/tag/fr

Original code: ⩾9s
This code: ⩾2s

Every change has been tested before/after with hyperfine and I checked that the produced files are exactly the same for several (2) dictionaries.

Ideally, I would like to be able to bypass dictfmt in the Plato script and produce directly a DICT.org file but I have trouble finding a good documentation about the format.

- Smarter use of buffers
- Read and write to file instead of standard input and output
@ariasuni ariasuni changed the title Improve performance a lot, and handle more than one synonym Improve performance a lot Oct 10, 2023
@baskerville

baskerville commented Oct 11, 2023

Copy link
Copy Markdown
Owner

We could even go further and not have to convert from StarDict by adding support for this format in the dictionary module. You might also be interested in this pull request.

@ariasuni

ariasuni commented Feb 9, 2024

Copy link
Copy Markdown
Author

Sadly, I don’t think I will have time in the foreseeable future to work on that. Still, was fun to work on and an immediate improvement over what’s already existing.

I opened an issue on ebook-reader-dict’s repo so that they could provide directly the correct format for Plato.

@ariasuni

ariasuni commented Aug 5, 2024

Copy link
Copy Markdown
Author

I’m not sure if you’d be willing to merge this? I could make the appropriate change to the convert-dictionaries.sh script of Plato (since it’s a relatively minor change). It would improve the speed of the process with very little work.

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.

2 participants