Re: Iterator Class?
From: Will Hartung (willh_at_msoft.com)
Date: 07/28/04
- Next message: Roedy Green: "Re: Fading in/out images. Please help!"
- Previous message: Al Murphy: "Fading in/out images. Please help!"
- In reply to: Richard Chrenko: "Re: Iterator Class?"
- Next in thread: Richard Chrenko: "Re: Iterator Class?"
- Reply: Richard Chrenko: "Re: Iterator Class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jul 2004 12:37:14 -0700
"Richard Chrenko" <richard.chrenko@solarenergy.ch> wrote in message
news:opsbuseko0h18bhh@news.hsr.ch...
> I have done performance testing using both get() and Iterator.next(), and
> there is a significant performace penalty when using get() for long Lists.
> It appears as though get() insists on iterating from the beginning of the
> list to arrive at the desired element. For short Lists, however, the
> overhead of constructing the Iterator object outweighs its benefits.
I'll disagree with this, falling on the "fuzzy" code clarity and consistency
metric side of the fence, and benefits it provides over micromanaging which
iteration method to use.
I use Iterators basically without thinking "gee is this a big list or a
small list", and never worry about the difference. So far in the systems
I've written, the profiler has never complained about iterating over a 10
element list.
The cognitive load that Iterators lift off of the user is very uplifting.
Regards,
Will Hartung
(willh@msoft.com)
- Next message: Roedy Green: "Re: Fading in/out images. Please help!"
- Previous message: Al Murphy: "Fading in/out images. Please help!"
- In reply to: Richard Chrenko: "Re: Iterator Class?"
- Next in thread: Richard Chrenko: "Re: Iterator Class?"
- Reply: Richard Chrenko: "Re: Iterator Class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|