[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Style question
Thank you all who responded to my mail. We had discussion in our code review
about it. I was suggesting to declare the varibles with in for loop if they
are not being used out side. Another team member was suggesting that it is
Also, which one is fast? using Iterator or get the size() and use
elementAt(i) for vector?
From: Michael Campbell [mailto:email@example.com]
Sent: Sunday, November 03, 2002 9:10 AM
To: John Camerin; firstname.lastname@example.org
Subject: RE: Style question
--- John Camerin <email@example.com> wrote:
> The reason for the increased performance when declaring the size
> prior to the loop is that the time to call a method is about 2 to 3
> greater than the time to get a local variable.
Yes, I was well aware that it was faster. There was a lot of
discussion after the fact of the initial question about it, so I
decided to test it explicitly mainly to see how MUCH faster it was.
Yahoo IM: michael_s_campbell
Do you Yahoo!?
HotJobs - Search new jobs daily now