YunoHost / issues

General issue tracker for the YunoHost project
72 stars 8 forks source link

regenconf is super slow #2392

Open selfhoster1312 opened 4 months ago

selfhoster1312 commented 4 months ago

I placed a "bug" label because it's unbearably slow even on a really fast machine.

There's a ton we can do to make it faster... i've been digging into the source code and so far i've found:

I have yet to properly benchmark this on a raspberry pi, but on x86, a naive (not optimized) reimplementation in Rust gets:

Command Python Rust Python (raspi) Rust (raspi)
regen-conf --list-pending 0.265s 0.003s 11.555s 0.026s
hook list conf_regen 0.150s 0.002s 5.975s 0.025s

I haven't reimplemented the rest of regenconf (yet), but there's not a lot of big features missing (syntax coloring, custom log sharing..) which i don't think is as important as running fast (and could be reimplemented if really needed). Two orders of magnitude of slowness (x100) is quite a big deal! :(

alexAubin commented 4 months ago

md5 is slow...

Honestly I very much doubt that md5 hashing is the issue ... just look at the call to yunohost settings get etc from the bash hooks ...

selfhoster1312 commented 4 months ago

Added benchmarks from an actual Raspberry pi running the two versions (Python/Rust).