Re: [Banshee-List] Track dictionary in TrackListDatabaseModel



Mike Urbanski wrote:
> On Sat, 2008-01-05 at 12:33 +0100, LCID Fire wrote:
>> I was looking into TrackListDatabaseModel and wondered why the tracks
>> are managed in a Dictionary?
> 
> This is actually a good choice.  
> 
> Look ups and inserts into a hash table are a near O(1) operations on
> average.  Look ups are O(n) in theory, but you're not likely to see
> that.
You right. Although I think it would be interesting how this performs in
contrast to using an array - what the performance gain to memory usage is.

> Also, considering that db key values do not necessarily correspond to
> list index values, you would run into a potentially memory intensive
> data sparsity issue.
In this implemenation it doesn't matter.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]