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


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

Re: The first 10 files

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail
From Wojtek <nowhere@a.com>
Newsgroups comp.lang.java.programmer
Subject Re: The first 10 files
Date Fri, 15 Mar 2013 10:31:59 -0700
Organization A noiseless patient Spider
Lines 47
Message-ID <mn.7a777dd3df9ee7cf.70216@a.com> (permalink)
References <mn.d04a7dd156c148ef.70216@a.com> <ke23sm$afb$1@dont-email.me> <mn.70bb7dd3ff682a5b.70216@a.com> <aqgc14FilbeU1@mid.individual.net>
Mime-Version 1.0
Content-Type text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding 8bit
Injection-Info mx05.eternal-september.org; posting-host="913a58905027d5a3bf7c700d71b3a757"; logging-data="19521"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9ZXcDFsffOtj+epPgPkBU7I2e/3pkoY0="
X-Newsreader MesNews/1.08.03.00-gb
Cancel-Lock sha1:hSfKhMcxFXOrT6vgYM+3BTN/D1E=
Xref csiph.com comp.lang.java.programmer:22960

Show key headers only | View raw


Robert Klemme wrote :
> On 14.03.2013 11:07, Wojtek wrote:
>
>> So NIO is about 4-5 times faster than IO. The first NIO run looks like
>> an anomoly, might be some JRE loading happening.
>>
>> All the runs produce different timings, might be a Windows caching
>> effect. However the NIO is consistently much faster overall.
>
> I am not convinced that this conclusion is warranted.  There are a few 
> factors which I believe make your conclusion questionable:
>
> - You included class loading time in your measurement.  For example, assuming 
> that all io functionality is implemented on top of nio it would be logical to 
> expect more classes to be loaded.  There are a number of use cases where it 
> matters - but there are also use cases where it doesn't matter (long running 
> servers).

The class loading would be part of a real project. The alternative is 
to keep an object around which holds a link to a directory. Actually 
many objects linked to many directories. Also the file list will change 
as files are added and deleted.

> - Generally we are dealing with quite low timings (around 100ms) and 
> relatively high variations.  Also the test was made on Windows and the 
> System.currentTimeMillis() is known to be imprecise on that platform (in the 
> order of tens of milliseconds).

Fair enough.

> - Your io approach does not use FileFilter which some have suggested to be a 
> way to avoid constructing a large result array.

Yes, but to filter the result still means loading each file name, then 
checking to see if it matches the filter.

> - The test is an artificial situation.  With all factors like JVM involved it 
> may be that in a realistic application things look different to an extent 
> that the differences you measured here do not matter any more.

While the absolute times may be questionable, the relative times are 
consistent.

-- 
Wojtek :-)

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


Thread

The first 10 files Wojtek <nowhere@a.com> - 2013-01-26 01:14 -0800
  Re: The first 10 files Roedy Green <see_website@mindprod.com.invalid> - 2013-01-26 02:44 -0800
    Re: The first 10 files Lew <lewbloch@gmail.com> - 2013-01-26 10:20 -0800
  Re: The first 10 files "John B. Matthews" <nospam@nospam.invalid> - 2013-01-26 06:31 -0500
    Re: The first 10 files Wojtek <nowhere@a.com> - 2013-01-26 15:42 -0800
      Re: The first 10 files Jim Janney <jjanney@shell.xmission.com> - 2013-01-26 17:13 -0700
      Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 21:21 -0500
      Re: The first 10 files "John B. Matthews" <nospam@nospam.invalid> - 2013-01-26 22:05 -0500
  Re: The first 10 files Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-01-26 08:24 -0400
    Re: The first 10 files Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-01-26 08:25 -0400
    Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 13:26 -0500
      Re: The first 10 files Robert Klemme <shortcutter@googlemail.com> - 2013-01-26 22:15 +0100
        Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 16:25 -0500
        Re: The first 10 files Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-26 17:06 -0500
          Re: The first 10 files Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-26 15:21 -0800
            Re: The first 10 files Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-26 20:42 -0500
              Re: The first 10 files Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-26 17:56 -0800
                Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 21:29 -0500
                Re: The first 10 files Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-26 21:56 -0500
                Re: The first 10 files Jim Janney <jjanney@shell.xmission.com> - 2013-01-26 20:51 -0700
                Re: The first 10 files Jim Janney <jjanney@shell.xmission.com> - 2013-01-26 20:47 -0700
              Re: The first 10 files Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-01-26 22:02 -0400
                Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 21:35 -0500
                Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 21:43 -0500
                Re: The first 10 files Robert Klemme <shortcutter@googlemail.com> - 2013-01-27 13:55 +0100
                Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 17:50 -0500
                Re: The first 10 files Robert Klemme <shortcutter@googlemail.com> - 2013-02-25 21:53 +0100
                Re: The first 10 files Jim Janney <jjanney@shell.xmission.com> - 2013-01-26 20:57 -0700
                Re: The first 10 files Wojtek <nowhere@a.com> - 2013-01-26 21:20 -0800
                Re: The first 10 files Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-01-27 07:23 -0400
                Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-27 20:36 -0500
                Re: The first 10 files Wojtek <nowhere@a.com> - 2013-01-28 16:28 -0800
            Re: The first 10 files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-26 21:23 -0500
            Re: The first 10 files Roedy Green <see_website@mindprod.com.invalid> - 2013-01-26 19:09 -0800
  Re: The first 10 files Jim Janney <jjanney@shell.xmission.com> - 2013-01-26 16:00 -0700
  Re: The first 10 files Knute Johnson <nospam@knutejohnson.com> - 2013-01-26 18:37 -0800
    Re: The first 10 files Wojtek <nowhere@a.com> - 2013-03-14 03:07 -0700
      Re: The first 10 files lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-03-14 12:49 +0000
      Re: The first 10 files Robert Klemme <shortcutter@googlemail.com> - 2013-03-15 11:38 +0100
        Re: The first 10 files Wojtek <nowhere@a.com> - 2013-03-15 10:31 -0700

csiph-web