Bug 350075 - Import of recipes takes too long
Summary: Import of recipes takes too long
Status: RESOLVED FIXED
Alias: None
Product: krecipes
Classification: Applications
Component: general (show other bugs)
Version: 2.0-beta2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-10 06:03 UTC by Vit Pelcak
Modified: 2016-02-26 12:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vit Pelcak 2015-07-10 06:03:28 UTC
When I want to import mmf file of recipes, it takes very long. It is roughly one recipe per second. I had imported some 14k recipes and it took whole night.

Also deleting recipes takes ages. Deleting some 10 of them can take whole minute.

I use SQLite as database.

I spotted, that during import only one thread is used which in todays time of multicores and hyper threading is waste of time.

Could you please work on some improvements?

Reproducible: Always
Comment 1 Vit Pelcak 2015-07-10 09:15:00 UTC
You can download databases for import for testing here: http://www.ffts.com/recipes.htm
Comment 2 José Manuel Santamaría Lema 2016-02-26 12:39:35 UTC
Git commit aea810e290ce605c0255aea56c9652744a8244ae by José Manuel Santamaría Lema.
Committed on 26/02/2016 at 12:38.
Pushed by joselema into branch 'master'.

Use transactions when exporting recipes.

This reduces a lot the time to get a large number of recipes into the database.

M  +18   -3    src/backends/qsqlrecipedb.cpp
M  +4    -0    src/backends/qsqlrecipedb.h
M  +5    -0    src/backends/recipedb.h
M  +12   -0    src/importers/baseimporter.cpp

http://commits.kde.org/krecipes/aea810e290ce605c0255aea56c9652744a8244ae