Andreas Ekstrand wrote:

> I thought I'd get an answer like that and I know this is an unusual way of 
> using Fl_Group. Anyway, compiled in Visual Studio Debug mode, Fl_Group::clear 
> with approximately 8000 children takes about 1500ms compared to the previous 
> implementation which took about 870ms.

okay, that's a significant difference.

> Actually that difference is much larger with optimization in Release mode, 
> although I don't have any figures from there.

I don't understand that. You say that the difference is much
larger _with_ optimization in Release mode? Actually the
difference should be much smaller.

> With Fl_Scroll::remove in Debug mode, clear took about 2400ms.

With the old (1.1) or new (1.3) implementation?

For the time (and implementation) being, I assume that the
fastest way to do what you want would be to:

(a) remove/restore the scrollbars (as you do now)
(b) use Fl_Scroll::clear()

If you use Fl_Scroll::clear() w/o removing the scrollbars,
this could be slower than using Fl_Group::clear(), but if
you remove the scrollbars then Fl_Scroll::clear() ought to
be faster *now* (because it removes the widgets from the
last to the first, whilst Fl_Group::clear() does it the
other way intentionally).

I emphasize "now" because of two reasons:

(1) I'm sure that is was slower in FLTK 1.1
(2) I can't guarantee that it will stay as it is [1]

[1] There is a chance that this will fail with a double
delete or accessing a deleted widget under the same
circumstances that should be avoided with the change
in Fl_Group::clear().

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to