I did some quick testing with the emulator (creating 3000 links to the same document). Some measurements results on the emulator and some preliminary conclusions.
I used the Book-View, sorted on title.
Book-View: 22 books
load_dir_from_metadb() ~75ms
load_items_in_model() ~200ms
Book-View: 3022 books
load_dir_from_metadb() ~2000ms
load_items_in_model() ~250ms
Using a different sorting method does not change the time significantly (size, date-added, type).
The Recently-Read View uses a LIMIT(38) in the SQL query.
Recently-Read View: 3022 books
load_dir_from_metadb() ~1000ms
load_items_in_model() ~200ms
Favourite-View( dr1000-hackx): 3022 books (of which only 2 are favourite)
load_dir_from_metadb() <100ms
load_items_in_model() <100ms
Some early conclusions:
- The database access consumes most of the time.
- Even when using LIMIT the database access will still use a lot of time. Although time is halved, which might be enough to make it usable for 3000 books.
- Using tags to limit the number of books reduces the time considerably.
- It seems that most time is consumed in sorting the documents (or copying from the database ) and not in selecting the documents in the database.
TODO:
- Check influence of (many) thumbnails in the database
- Removing sorting from SQL-command to check if it is sorting or copying 'selected' data from database to memory that is consuming the time.
- Using OFFSET/LIMIT as a test to check impact.
@Iņigo: How long does it normally take to show the Book-view on your DR?
Marcel.
|