UPnP Kioslave and Amarok Collection notes

Jeff Mitchell mitchell at kde.org
Sun May 16 07:19:22 CEST 2010


On 05/15/2010 02:13 PM, Lukas wrote:
> MySQL is really fast in storing things up, and it shouldn't count for
> majority of time used in full scan. In most ocations it takes less than
> 0.005s for a line to store. However, as far as I remember, Amarok uses
> MyISAM tables for collection (corret me if i'm wrong), that means tables
> gets locked during writes. Thisa could be asily fixed, by changing
> engine to InnoDB.
> 
> Even more, to minify count of writes, its is possible to feed a list of
> tracks after rescan to a temporary table stored on memory, and using
> joins delete removed tracks from mysql collection and add new ones. So
> even using MyISMA full rescan wouldn't couse much problem :)

Actually, we found with the MySQL-based SqlCollection (the "normal"
local collection) that MySQL queries can be a very, very significant
time sink. This was using temporary tables.

This was solved for the SqlCollection by doing extremely aggressive
caching of all the data in-memory, and then reducing that into only a
few queries. It spend things up by a few hundred to a few thousand
percent, at the cost of a pretty decent increase in complexity of the
code. See ScanResultProcessor for the scary details.

Not saying that you need to follow that model exactly, but you may want
to consider ways to minimize SQL queries. Using shared pointers a la
Meta, the actual memory usage does not have to be all that large (think
about exactly how much text you can fit into each megabyte, and how many
tracks that corresponds to).

This may also become important if you think about Amarok Mobile
considerations, where the SQL storage available may not be MySQL.
Minimizing the number of queries also means minimizing the number of
queries that have to be abstracted.

--Jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20100516/84fd73f8/attachment.sig 


More information about the Amarok-devel mailing list