|
From: Jorg S. <Jor...@gm...> - 2003-08-10 13:25:11
|
> > It's my feeling that trying to build a library out of itunesdb.c will > > cause a lot of overhead. It seems more efficient if the program at > > hand takes care of the representation itself. itunesdb.c itself can be > > used in different programs quite easily. That's the reason why it's > > under LGPL. > > There may be several arguments for not using a library but > efficiency really isn't one of them. The overhead of using > shared objects is really really really almost unmeasurable. If > this wasn't the case people would statically like stuff for speed > right? I wasn't thinking about shared object overhead. More about the additional layer we needed to introduce to make it neat. > Regarding slow down, this depends entirely on the implementation. > If you simply compile itunesdb.c as an so without modification > you won't see *any* slowdown. We interface can be at whatever > level we want right? > > If I ever have a bunch of time I might look into this again... > but I don't right now so its all hot air. Maybe it should go > on the TODO? Yes, there might be a way to make a lib without adding an additional layer. Basically we would have to include song.c, playlist.c and itunesdb.c. And we would have to define the data structure being used to hold the data and allow the application programs to mess with the data on their own. Otherwise a lot of recoding would have to be done all around the gtkpod source. Wouldn't be that much of a problem, though. > I'd say one of the biggest slowdowns with gtkpod right now is the > use of libid3. This is a notorious library that is written in > C++ (so it forces you to link with the c++ libs) and is well > known for producing ugly slow code. A much nicer library is libid3tag > from the MAD project. Another one for the TODO list maybe? Thanks for pointing that out. There is no particular reason I use libid3 (other than that I looked at easytag to learn how to handle tags). Changing is easy: just replace gboolean Id3tag_Read_File_Tag (gchar *filename, File_Tag *FileTag); gboolean Id3tag_Write_File_Tag (gchar *filename, File_Tag *FileTag); with functions using libid3tag. They are only called in file.c (three times). Cheers, JCS. |