[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
slow.
Also, which one is fast? using Iterator or get the size() and use
elementAt(i) for vector?
thanks
MANI
-----Original Message-----
From: Michael Campbell [mailto:michael_s_campbell@yahoo.com]
Sent: Sunday, November 03, 2002 9:10 AM
To: John Camerin; ajug-members@ajug.org
Subject: RE: Style question
--- John Camerin <jcamerin@getthere.com> wrote:
> The reason for the increased performance when declaring the size
> variable
> prior to the loop is that the time to call a method is about 2 to 3
> times
> 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
http://hotjobs.yahoo.com/