mudler / luet

:package: :whale: 0-dependency Container-based Package Manager using SAT solver and QLearning
https://luet.io
GNU General Public License v3.0
261 stars 24 forks source link

Bottleneck on store installed packages on local database #268

Open geaaru opened 2 years ago

geaaru commented 2 years ago

Luet version: All version

CPU architecture, OS, and Version: amd64

Describe the bug When luet tries to install a lot of packages is more visible the bottleneck on saving packages on Bolt DB. I added a log that measures the time and it's very high in an SSD disk.

The first patch done tries to open the bolt db only one time instead for every save. This reduces the time but it's yet too high.

https://github.com/geaaru/luet/commit/c444801442092263deb3055b3167b11c509fafec (after a period of test i will send a PR to upstream).

This is an example of the reported time on creating Mocaccino Funtoo ISO:

 904 packages added/updated in local db in 257969787 µs.

It's weird. I don't think that is so expensive to write on Bolt db.

I'm trying to see what are the alternative. I'm not sure that it's possible store all packages with only one shot. Maybe the solution is to use the Batch insert?