-
Notifications
You must be signed in to change notification settings - Fork 23
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
Import/loading takes a long time. How to speed up loading? #49
Comments
Cool!
That’s a lot. Even if the Raspberry Pi’s CPU is slow, it shouldn’t take so much time. Profiling on my computer doesn’t give interesting results, could you please provide profiling information on your Raspberry? You can get profiling information launching (I hope I’ll be able to read it even if it’s no the same platform, otherwise I’ll ask you to launch an additional command!) |
Done. The command did not work, but I put the commands into a file an run that. Here ist the full output: (available until March 2024) |
Here's is just one example of the usage (purpose of hyphenation: allow use of maxium font size on the tiny display of https://github.com/Wikinaut/pinetradio ). The first |
You may get slightly better results using the 0.14.0 version, as it may be a bit faster if your storage is slow (and it probably is). That could help with the 17 seconds spent mainly to list dictionaries, and the 30 seconds in the But except from this change, you have almost the same distribution of time than me. It could be possible to find optimizations, but nothing’s obvious for me now. |
new profile: |
A 10% improvement is good news, that’s what I was hoping for, but it’s not enough.
It looks like we saved some time listing dictionaries, importing the module seems to be much faster. For ~50s, there’s:
It should be possible to save some time, but there’s nothing obvious from what I see there :/. |
Perhaps an offline-preprocessing of the (used) dictionary? Could this help? |
I’ve tried to load a JSON (generated from the dictionary) on my laptop and it’s ~5 times faster than loading the Hunspell dictionary. With Pickle, it’s ~10 times faster. The benefits would be probably higher on slower systems. We could consider including these pre-processed dictionaries. Pickle and JSON are probably not the best solutions (for different reasons), good ideas are welcome 😁. |
I use
pyphen
for my Rasperry Pi Zero powered Internetradio https://github.com/Wikinaut/pinetradio .Loading always takes a very long time. Is there a way to decrease the loading time?
The text was updated successfully, but these errors were encountered: