#6 Very slow

closed
General (2)
5
2003-09-09
2003-09-09
No

I tried cataloging a set of MP3s on a CDR. I loop
through all the dirs and for each of the MP3 files I
find I do simple code like:

ID3Reader reader = new
ID3Reader(sourceFile.getAbsolutePath());
ExtendedID3Tag tag1 = reader.getExtendedID3Tag();
artist = tag1.getArtist();
album = tag1.getArtist();
title = tag1.getTitle();

It takes literally FOREVER to scan the CD. I was using
jid3lib before but abandoned it due to bugs. I am
trying to find a new lib for reading MP3 tags in Java
and your seems to work very well....but it's so slow
it's unusable for my project. :-(

It probably doesn't show up when reading off a HD but
reading off a CDR really highlights the issue.

jid3lib was able to scan the entire CDR and give me all
the tags for each file in about 10-15 seconds. The same
logic using your lib takes minutes and quite a few of
them... :-(

Discussion

  • Florian Heer

    Florian Heer - 2003-09-09

    Logged In: YES
    user_id=223730

    I woldn't call that a bug, for it is a feature.

    If you only want to read V1-Tags, use the following code (as
    published in the 'Help'-forum) for each file:
    ExtendedID3Tag xtag = ID3Reader.readExtendedTag(new
    RandomAccessFile(dir.getAbsolutePat(), "r"));

    That way only the last 128 bytes of each file is read.

    The way you do it, my package reads and analyzes every file
    entirely, leading to long delays. Reading each byte of a
    full CD takes its time.

     
  • Florian Heer

    Florian Heer - 2003-09-09
    • status: open --> closed
     
  • Nobody/Anonymous

    Logged In: NO

    Well... it is awfully slow, I do have to confirm. And it is not
    Javas fault - not this time :)

    Using Your library scanning a (cached) file of 3-4 MByte takes
    about a second.

    Having had some free hours the last 3 days I've written an
    own implementation of a MPEG audio file parser (along with its
    own ID3V1/V2 parser) which does quite the same job... but
    way faster (about 100 milliseconds for a cached 10 MByte file)
    . That's quite a difference I'd say... ah well, and I don't even
    need a RandomAccessFile to get anywhere, a simple
    InputStream really does the job (even for reading the ID3 tags
    which is now quite fast even when scanning through the whole
    file).

    contact me (http://apexo.de/) if you are in urgent need of a
    faster lib...

     
  • Florian Heer

    Florian Heer - 2003-10-25

    Logged In: YES
    user_id=223730

    My dear young anonymous friend,

    if you are such a great developer, why don't you sign up
    with sourceforge and try to submit patches?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks