Martin Sorgatz wrote:
>
> Ernst de Haan wrote:
>
> > Small performance enhancement suggested.
> >
> > The performance of java.util.Vector.copyInto(Object[]) could be
> > improved, I believe. Currently the implementation does something like:
> >
> > public void copyInto(Object[] anArray)
> > {
> > int i = elementCount;
> > while (i-- > 0)
> > {
> > anArray[i] = elementData[i];
> > }
> > }
> >
> > Why not make it:
> >
> > public void copyInto(Object[] anArray)
> > {
> > System.arraycopy(elementData, 0, anArray, 0, elementData.length);
> > }
> >
> > I personally use the copyInto method very often.
>
> If you want a performance improvement you should not copy
> elementData.length
> elements but just elementCount elements ;-)
*LOL* You're absolutely right. Ha ha ha. Man, we should get our own
jdk-source-code-performance-improvement newsgroup! ;)
> > Is this the place I should post such issues, or should I contact
> > JavaSoft or so?
>
> I don't know (I'm not a porter). Why not build your own classes.zip?
No way. I'm not that desparate. I'd have to rebuild the classes.zip
every time I get a new JDK update. It's not that I really _need_ the
performance that bad, I just want to help improve Java (especially on
unices).
Ernst
--
_________________________________________________________
| "Come to me all you who are weary and burdened, and I |
| will give you rest." |
| |
| -- Jesus Christ (Mt. 11:28) |
|_______________________ _________________________________|
| Ernst de Haan | email [EMAIL PROTECTED] |
| Java programmer | web members.xoom.com/znerd/ |
| Utrecht University | icq# 21871778 |
|_______________________|_________________________________|