Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #5644
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!postnews.google.com!r33g2000prh.googlegroups.com!not-for-mail |
|---|---|
| From | lewbloch <lewbloch@gmail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Passing a Method Name to a Method, Redux |
| Date | Fri, 24 Jun 2011 08:38:45 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 28 |
| Message-ID | <b2d9149c-fd3a-4c6e-b32c-b95e961867e8@r33g2000prh.googlegroups.com> (permalink) |
| References | <fpg7079ca2dtgipdphr8rm234kgmkd1t3l@4ax.com> <iu0pbg$26n$1@dont-email.me> <1lu707p0cpr9vhrpv51d7hmst6bt1qdbcv@4ax.com> <iu129n$d0q$1@dont-email.me> |
| NNTP-Posting-Host | 127.6.6.6 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1308929925 11442 127.0.0.1 (24 Jun 2011 15:38:45 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Fri, 24 Jun 2011 15:38:45 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | r33g2000prh.googlegroups.com; posting-host=127.6.6.6; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-Header-Order | ASELCHRU |
| X-HTTP-UserAgent | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30,gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5644 |
Show key headers only | View raw
markspace wrote:
> ...
> BTW I refactored your test that you were copy-and-pasting around into
> one method. Using techniques I mentioned in my first post to you on
> this subject.
>
> private static void time( TestCase r ) {
> long StartTime = System.nanoTime();
> for( int i = 1; i <= nRepetitions; i++ ) {
> r.parse();
> }
> long EndTime = System.nanoTime();
> long Duration = EndTime - StartTime;
> System.out.println( " Duration=" + (Duration/1e9) );
> }
You'll want to run each loop a bunch of times (10,000? 100,000? >=
1M?) before starting the timing loop in order to cancel the effects of
HotSpot warmup.
Unless your real-world scenario pretty much guarantees that HotSpot
won't be a factor.
Micro-benchmarks in Java are, at best, a dicey basis for any
performance conclusions.
--
Lew
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-23 16:03 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-23 16:26 -0700
Re: Passing a Method Name to a Method, Redux blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-27 21:41 +0000
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-23 17:24 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-23 19:46 -0700
Re: Passing a Method Name to a Method, Redux blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-04 03:26 +0000
Re: Passing a Method Name to a Method, Redux lewbloch <lewbloch@gmail.com> - 2011-07-04 03:41 -0700
Re: Passing a Method Name to a Method, Redux blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-05 19:07 +0000
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-23 17:34 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-23 19:42 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-23 18:30 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-23 19:48 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-23 21:02 -0700
Re: Passing a Method Name to a Method, Redux lewbloch <lewbloch@gmail.com> - 2011-06-24 08:38 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-24 09:04 -0700
Re: Passing a Method Name to a Method, Redux Lew <noone@lewscanon.com> - 2011-06-26 13:43 -0400
Re: Passing a Method Name to a Method, Redux Lew <noone@lewscanon.com> - 2011-06-26 14:31 -0400
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-24 11:45 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-24 12:19 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-26 20:39 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-26 23:33 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-27 13:53 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-27 18:03 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-28 11:41 -0700
Re: Passing a Method Name to a Method, Redux blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-24 19:19 +0000
Re: Passing a Method Name to a Method, Redux Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-23 19:36 -0700
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-24 11:50 -0700
Re: Passing a Method Name to a Method, Redux Jeff Higgins <jeff@invalid.invalid> - 2011-06-24 17:25 -0400
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-26 20:42 -0700
Re: Passing a Method Name to a Method, Redux markspace <-@.> - 2011-06-26 23:27 -0700
Re: Passing a Method Name to a Method, Redux Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-27 03:04 -0400
Re: Passing a Method Name to a Method, Redux Gene Wirchenko <genew@ocis.net> - 2011-06-27 13:12 -0700
Re: Passing a Method Name to a Method, Redux Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-27 13:36 -0700
Re: Passing a Method Name to a Method, Redux Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-06-24 15:50 -0700
csiph-web