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


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

Re: Getter performance

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Getter performance
Date Sat, 15 Oct 2011 15:20:19 -0700
Organization A noiseless patient Spider
Lines 26
Message-ID <j7d0v7$eo5$1@dont-email.me> (permalink)
References <4e99f537$0$623$426a74cc@news.free.fr> <4e99fcdf$0$295$14726298@news.sunsite.dk> <4e99fe53$0$281$14726298@news.sunsite.dk> <j7cvqo$tcp$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Sat, 15 Oct 2011 22:20:23 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="15109"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xxwtQABDBma5xC6mIdFXic7EJpZBeMhg="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To <j7cvqo$tcp$1@news.albasani.net>
Cancel-Lock sha1:iosklMIIDTeYC5+ILx73aDF0XLs=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8838

Show key headers only | View raw


On 10/15/2011 3:00 PM, BGB wrote:

> On 10/15/2011 2:42 PM, Arne Vajhøj wrote:
>> With 1000000 and -server I get:
>>
>> 1763
>> 1608
>>
>> which is rather close.

> this is an interesting result...
>
> I was aware that the JVM optimized getters, but unclear is why they are
> slightly faster than direct field access, rather than exactly the same
> speed (or sometimes slightly faster and sometimes slightly slower).


I don't think the result indicates that getters are slightly faster, or 
vice versa.  It's just to close too call, and there's isn't really 
anyway to say one is universally better, speed-wise.

Software engineering-wise, and best practice-wise, the getter is 
undoubtedly the better option.


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


Thread

Getter performance Aéris <aeris@imirhil.fr> - 2011-10-15 23:03 +0200
  Re: Getter performance Arne Vajhøj <arne@vajhoej.dk> - 2011-10-15 17:36 -0400
    Re: Getter performance Arne Vajhøj <arne@vajhoej.dk> - 2011-10-15 17:42 -0400
      Re: Getter performance BGB <cr88192@hotmail.com> - 2011-10-15 15:00 -0700
        Re: Getter performance markspace <-@.> - 2011-10-15 15:20 -0700
          Re: Getter performance David Lamb <dalamb@cs.queensu.ca> - 2011-10-20 12:45 -0400
            Re: Getter performance Roedy Green <see_website@mindprod.com.invalid> - 2011-10-21 14:27 -0700
              Re: Getter performance Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-21 18:57 -0700
                Re: Getter performance Patricia Shanahan <pats@acm.org> - 2011-10-22 07:27 +0100
                Re: Getter performance Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-22 09:57 -0300
              Re: Getter performance Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-21 22:12 -0400
    Re: Getter performance Aéris <aeris@imirhil.fr> - 2011-10-15 23:59 +0200
      Re: Getter performance Arne Vajhøj <arne@vajhoej.dk> - 2011-10-15 19:44 -0400
        Re: Getter performance Aéris <aeris@imirhil.fr> - 2011-10-16 13:14 +0200
          Re: Getter performance Lars Enderin <lars.enderin@telia.com> - 2011-10-16 16:28 +0200
  Re: Getter performance Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-16 09:47 -0400
  Re: Getter performance Jaap Droogers <JaapDroogers@unusable.meel.homelinux.net> - 2011-10-16 22:12 +0200
    Re: Getter performance BGB <cr88192@hotmail.com> - 2011-10-16 13:58 -0700
    Re: Getter performance David Lamb <dalamb@cs.queensu.ca> - 2011-10-20 12:51 -0400
      Re: Getter performance Paul Cager <paul.cager@googlemail.com> - 2011-10-21 08:49 -0700
  Re: Getter performance Roedy Green <see_website@mindprod.com.invalid> - 2011-10-21 08:02 -0700
  Re: Getter performance Wanja Gayk <brixomatic@yahoo.com> - 2011-10-22 21:11 +0200

csiph-web