[haiku-development] BList resize algorithm

  • From: "Rene Gollent" <anevilyak@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 9 Jun 2008 12:59:50 -0500

Hi,

I was looking through BList's code while looking at list view
performance, and I notice that its resizing behavior appears quite
naive: if you hit the list capacity when adding an item, it appears to
resize the list by 1 item only, which to me seems quite dumb. Wouldn't
it be smarter to use a heuristic such as what std::vector does and
double the size of the list each time? Or am I missing some trick
here?

Regards,

Rene

Other related posts: