[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Number of articles
I believe the Quick sort is n (Log n). The bit field would give n. Also with 1000
articles the memory for each hit is 1000 * 4 = 4000 bytes (4 is the size of a
pointer). For a bit field it's 1000 / 8 = 125 bytes. That's 32 times difference, I
forgot about the size of a pointer when I said 8 times.
I'm not saying I have to do it this way. It just seems to be more to your benefit.
One problem is that I could not get the smallest article number with a bit field. So
if that is nessecary then I will be glad to do the Quick sort.
Aaron Turner wrote:
> On Fri, 16 Jul 1999, Dean Giberson wrote:
>
> > Do the articles have to be sorted? If they don't then the overhead involed in
> > setting up a quick sort can be by-passed and I could use a bit field.
>
> I was just thinking that a quicksort alogrithm would be faster for a
> large number of results since it reduces the number of comparisions.
>
> > The Add/Remove functions already exist. And the search/scan fuctions
> > would let me go through the list in a liner fashion.
>
> If that's faster, cool.
>
> > The bit field cuts the memory by 8, since I can fit 8 checkes into one
> > byte. And the code size is reduced since I'm using existing code.
> > Win-win.
>
> I would be more concered optomizing for speed than memory usage. We've
> got 1GB of RAM.
>
> -Aaron
>