My prog is a streaming mp3 player. At program start, a file is downloaded containing a list of tracks available online at the moment. Currently there are 20.000.000 items in this list!
This textfile is read and converted to a list(of mediadata), where mediadata is a custom class containg 14 items per track (e.g. artist as string, title as string, album as string, duration as string...)
So I have a list(of mediadata) containing approx. 20.000.000 items.
Locally I likewise have playlists containing roughly 1000 tracks each, existing of the same type (mediadata)
My problem:
Because not all songs online are always available I need to compare these playlists based on "artist" and "title" (the other values may be different!) against MusicLibrary, and if a match is found, I load the data from the MusicLibray into my player.
I can do this with a for each loop of course,but this takes ages to load.
What would be the fastest way to make this comparison? A binarysearch is not possible as far as I know?
Am I approaching this problem the wrong way? Any refreshing ideas?