Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28630

Re: where's your Vector, victor

From leif.roar@invalid.com (Leif Roar Moldskred)
Subject Re: where's your Vector, victor
Newsgroups comp.lang.java.programmer
References <19baa0fb-e0fb-4565-b1eb-44018eb3045d@googlegroups.com> <lma4pp$a4s$1@dont-email.me> <lma88r$4hn$1@dont-email.me>
Message-ID <g9CdnURH0PPigxbOnZ2dnUVZ8mSdnZ2d@giganews.com> (permalink)
Date 2014-06-01 07:37 -0500

Show all headers | View raw


Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
> 
>     I'm "mostly" in agreement.  For curiosity's sake, though, I ran
> a few simple timing tests and found that Vector took about 35% more
> time than ArrayList (for the mix of operations I tried).
>

Yes, but optimizations in the JVMs has reduced the costs of
/synchronized/ significantly since the introduction of ArrayList.

Another difference between Vector and ArrayList is that Vector's
growth policy is specifically to grow with a specific size /n/,
whereas ArrayList's growth policy is left as an implementation
detail. For some use cases, this can be significant -- although
if it is, you should probably reconsider your whole approach.

-- 
Leif Roar Moldskred

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

where's your Vector, victor bob smith <bob@coolfone.net63.net> - 2014-05-30 01:11 -0700
  Re: where's your Vector, victor Josip Almasi <joe@vrspace.org> - 2014-05-30 12:45 +0200
    Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 08:06 -0400
    Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-30 19:28 +0200
  Re: where's your Vector, victor Joerg Meier <joergmmeier@arcor.de> - 2014-05-30 12:58 +0200
  Re: where's your Vector, victor Knute Johnson <eternal@knutejohnson.com> - 2014-05-30 07:32 -0700
    Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 11:31 -0400
      Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-30 19:30 +0200
      Re: where's your Vector, victor Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2014-05-31 00:30 +0300
        Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 18:23 -0400
          Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-31 12:17 +0200
      Re: where's your Vector, victor leif.roar@invalid.com (Leif Roar Moldskred) - 2014-06-01 07:37 -0500
  Re: where's your Vector, victor Roedy Green <see_website@mindprod.com.invalid> - 2014-06-06 01:00 -0700

csiph-web