Opened 14 years ago

Closed 14 years ago

#665 closed enhancement (fixed)

MythMusic AllMusic::resync() speed increases

Reported by: mythtv@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version:
Severity: low Keywords:
Cc: Ticket locked: no

Description

This will include multiple, independent speed improvements, each attached as a patch. Speedups are based on a base time of 10.20 seconds on my machine, for a test set of 31,050 music files. This is based on 27 copies (the original plus 26 artificial copies) of my real music collection. Each artificial copy is the same as real music file with a capital letter prepended to the artist. TreeLevels? is set to "artist album title".

mythmusic-speedup-cache.patch: Improvement: 1.15 seconds

changes computation of lastPlay{Min,Max} and playcount{Min,Max} to only grab the values once. LastPlay?() is the expensive call, but did both for consistency.

mymthmusic-speedup-lastplay.patch: Improvement: 0.95 seconds (beyond previous patch)

rather than converting LastPlay? to a QDateTime, convert it directly into a double.

mythmusic-speedup-buildtree.patch: Improvement: 2.36 seconds (independent)

changes the tree-building procedure to be batch. At each node, the list of Metadata to go into that node is divided into the subtrees into which it should go. This patch greatly improves trees with large fan-outs. With TreeLevels? set to "splitartist artist album title", the fan-out is significantly lower, so this only saves 0.15 seconds. This patch changes the much more code than the other two.

The first two improve the metadata-building loop in resync(). The last one improves the buildTree procedure. Applying all three patches reduces load time from 10.20 seconds to 5.89 seconds, a 42% decrease. On music collections with higher fan-out, the improvement will be more dramatic.

They are submitted as separate patches to simplify review.

Attachments (3)

mythmusic-speedup-buildtree.patch (7.8 KB) - added by mythtv@… 14 years ago.
proposed intoTree process change patch
mythmusic-speedup-cache.patch (945 bytes) - added by mythtv@… 14 years ago.
in query processing, only ask for LastPlay?() conversion once
mythmusic-speedup-lastplay.patch (884 bytes) - added by mythtv@… 14 years ago.
Convert directly from string of date to double

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by mythtv@…

proposed intoTree process change patch

Changed 14 years ago by mythtv@…

in query processing, only ask for LastPlay?() conversion once

Changed 14 years ago by mythtv@…

Convert directly from string of date to double

comment:1 Changed 14 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

(In [8003]) Closes #665.

Apply patches to speed up the tree building in mythmusic.

Note: See TracTickets for help on using tickets.