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


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

Re: Cost of creating objects?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Wed, 07 Aug 2013 05:02:03 -0500
Date Wed, 07 Aug 2013 13:02:01 +0300
From Donkey Hottie <donkey@fredriksson.dy.fi>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Cost of creating objects?
References <ktstsp$59k$1@news.albasani.net>
In-Reply-To <ktstsp$59k$1@news.albasani.net>
Content-Type text/plain; charset=ISO-8859-15
Content-Transfer-Encoding 7bit
Message-ID <phi9da-p0l.ln1@tempest.fredriksson.dy.fi> (permalink)
Lines 30
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-1bal7lbVRvybZS0mJXoe2/5MPYMDF0QmAMEgowVpsyhdMO/ExbWWbQgaghPRoEi8J4H93eJj3SNlKFI!i3mzjd1WC3QR1BW0KMyCu6AIzaEWAJamm4onfq5pH5UcltOfcv3l0lQRo7W+BY22hOuy
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2022
Xref csiph.com comp.lang.java.programmer:24909

Show key headers only | View raw


07.08.2013 10:44, Sebastian kirjoitti:
> @Override
> public int compare(AttrValue o1, AttrValue o2)
> {
>   Long ts1 = o1.getEffectiveSequenceNumber();  // ??
>   Long ts2 = o2.getEffectiveSequenceNumber();  // ??
>   return ts1.compareTo(ts2);
> }
> 
> Would you expect a measureable impact of creating these
> variables ts1, ts2, instead of "inlining" the calls to
> getEffectiveSequenceNumber(). (Using JDK 6?)
> 
> How can I reason about this things, probably influenced by
> JIT, without doing actually measurements, say as part of a
> code inspection?
> 
> -- Sebastian
> 

What is getEffectiveSequenceNumber() returning?

If Long, there is no way to prevent the creation of a Long.

If long, try and use long variables instead, and manually code the
comparison code, it's not that complicated anyway.

-- 

Try to value useful qualities in one who loves you.

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


Thread

Cost of creating objects? Sebastian <news@seyweiler.dyndns.org> - 2013-08-07 09:44 +0200
  Re: Cost of creating objects? Donkey Hottie <donkey@fredriksson.dy.fi> - 2013-08-07 13:02 +0300
    Re: Cost of creating objects? Sebastian <news@seyweiler.dyndns.org> - 2013-08-07 12:05 +0200
      Re: Cost of creating objects? Donkey Hottie <donkey@fredriksson.dy.fi> - 2013-08-07 14:08 +0300
      Re: Cost of creating objects? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-08-07 08:08 -0400
      Re: Cost of creating objects? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-08-07 20:14 -0700
        Re: Cost of creating objects? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-08-08 17:17 -0300
  Re: Cost of creating objects? Joerg Meier <joergmmeier@arcor.de> - 2013-08-07 12:37 +0200
  Re: Cost of creating objects? Sebastian <news@seyweiler.dyndns.org> - 2013-08-07 19:51 +0200
    Re: Cost of creating objects? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-08-07 15:51 -0400
      Re: Cost of creating objects? Lew <lewbloch@gmail.com> - 2013-08-07 16:52 -0700
        Re: Cost of creating objects? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-08-07 20:51 -0400
          Re: Cost of creating objects? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-08-08 11:24 +0300
            Re: Cost of creating objects? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-08-08 10:07 +0100
              Re: Cost of creating objects? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-08-08 17:34 +0300
                Re: Cost of creating objects? Arne Vajhøj <arne@vajhoej.dk> - 2013-08-08 10:42 -0400
                Re: Cost of creating objects? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-08-08 20:45 +0100
              Re: Cost of creating objects? Arne Vajhøj <arne@vajhoej.dk> - 2013-08-08 10:38 -0400
            Re: Cost of creating objects? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-08-08 10:13 -0400
    Re: Cost of creating objects? Arne Vajhøj <arne@vajhoej.dk> - 2013-08-07 20:28 -0400
      Re: Cost of creating objects? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-08-08 17:34 -0300
  Re: Cost of creating objects? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-08-07 19:19 +0100
    Re: Cost of creating objects? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-08-07 19:24 +0100
    Re: Cost of creating objects? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-08-07 20:03 -0700
      Re: Cost of creating objects? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-08-08 17:39 -0300
  Re: Cost of creating objects? Arne Vajhøj <arne@vajhoej.dk> - 2013-08-07 20:24 -0400

csiph-web