GNOME Bugzilla – Bug 143223
[id3demux] Optimize tag reading
Last modified: 2004-12-22 21:47:04 UTC
id3demux takes 17 iterations and almost 200 ms to read a tag from an mp3, ideally it should be much faster. This bug is similar to the oggdemux bug 143222.
In fact that only happens on the first file and is because id3demux does typefinding and loads typefind plugins. It doesn't happen on subsequent invocations. Try "gstreamer/tests/spidey_bench /some/music/file.mp3 > output" to see how fast it really is. That test autoplugs a pipeline and gets the tags. IUt does that for the same file 10 times. (The redirection is necessary to not get switches to the terminal in between and get real results.) It takes around 17.5ms here, which IMO is fine. Note that the number of iterations is irrelevant, because it just displays the granularity of the plugins involved. More iterations = higher granularity = better. I'm closing this as invalid.
Created attachment 28475 [details] test script Script used to test
Sometimes it's still unacceptably slow (50 ms) and sometimes it's fast (2 ms). It shouldn't really take more than a couple of ms to read the tags. I can't see why any expensive computations should be performed. Re-opening bug (until I have a reliable way of fetching tags). Sample output of a directory with 2 oggs and a bunch of mp3s: ogg (5) iterating (1 iters) took 314.5 ms mp3 (6) iterating (17 iters) took 76.4 ms ogg (4) iterating (1 iters) took 0.9 ms mp3 (7) iterating (17 iters) took 1.4 ms mp3 (7) iterating (17 iters) took 47.3 ms mp3 (7) iterating (17 iters) took 1.5 ms mp3 (7) iterating (17 iters) took 47.8 ms mp3 (6) iterating (17 iters) took 1.5 ms mp3 (6) iterating (17 iters) took 1.5 ms mp3 (6) iterating (17 iters) took 47.5 ms mp3 (6) iterating (17 iters) took 48.4 ms mp3 (6) iterating (17 iters) took 47.6 ms mp3 (6) iterating (17 iters) took 48.2 ms mp3 (7) iterating (83 iters) took 49.1 ms (all mp3 songs have id3 and id3v2 tags)
Yes, I know that task switches to gnome-terminal to print out that line are slow. As are hard disk accesses. closing again. After running that thing with redirection into a file and the files cached in RAM, I get _repeatedly_ output like this (all mp3s, had to remove tag counting because of "TypeError: lists are not supported"): mp3 (0) iterating (17 iters) took 478.7 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.5 ms mp3 (0) iterating (17 iters) took 2.3 ms mp3 (0) iterating (17 iters) took 2.2 ms mp3 (0) iterating (17 iters) took 2.3 ms mp3 (0) iterating (17 iters) took 2.3 ms