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


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

Re: One code is aggressively optimised, while another not. Why?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: One code is aggressively optimised, while another not. Why?
Date Wed, 12 Jul 2017 17:04:39 -0000 (UTC)
Organization A noiseless patient Spider
Lines 22
Message-ID <ok5kr7$q3o$2@dont-email.me> (permalink)
References <87lgnu5b9o.fsf@munus.decebal.nl> <ok5auj$3m4$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Wed, 12 Jul 2017 17:04:39 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="cef6ddcc313f310dfc2b281054641695"; logging-data="26744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LzunXxeCFs/CvGNq0yhminUJMG/89e4g="
User-Agent Pan/0.141 (Tarzan's Death; 168b179 git.gnome.org/pan2)
Cancel-Lock sha1:nrwNllCejzQ43bpPbuHRxj0cgyA=
Xref csiph.com comp.lang.java.programmer:36867

Show key headers only | View raw


On Wed, 12 Jul 2017 09:19:36 -0500, Joshua Cranmer 🐧 wrote:

> I don't know your quality of microbenchmark suite, but a result that
> takes around a thousand clock cycles or so strongly suggests that the
> optimizer did loop idiom detection to replace the loop with sum =
> f(start, end). That the second loop didn't suggests either that the loop
> didn't tickle the loop idiom detector or that it bailed on computing the
> result do to an overflow. Since my development computer is currently
> nonfunctional, I can't do any more detailed analysis.
>
Or possibly the optimiser knows a fast way to add long to long but not to 
add int to long. 

Alternatively, the compiler may do mixed length integer addition by 
extending the shorter representation and then adding two integers of the 
same length and possibly the optimiser can't do a lot to speed that up.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


Thread

One code is aggressively optimised, while another not. Why? Cecil Westerhof <Cecil@decebal.nl> - 2017-07-12 10:07 +0200
  Re: One code is aggressively optimised, while another not. Why? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-07-12 09:38 -0400
    Re: One code is aggressively optimised, while another not. Why? Cecil Westerhof <Cecil@decebal.nl> - 2017-07-13 09:51 +0200
      Re: One code is aggressively optimised, while another not. Why? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-07-13 11:05 -0400
        Re: One code is aggressively optimised, while another not. Why? Cecil Westerhof <Cecil@decebal.nl> - 2017-07-13 18:52 +0200
          Re: One code is aggressively optimised, while another not. Why? Cecil Westerhof <Cecil@decebal.nl> - 2017-07-13 19:51 +0200
  Re: One code is aggressively optimised, while another not. Why? Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2017-07-12 09:19 -0500
    Re: One code is aggressively optimised, while another not. Why? Martin Gregorie <martin@address-in-sig.invalid> - 2017-07-12 17:04 +0000
  Re: One code is aggressively optimised, while another not. Why? Arne Vajhøj <arne@vajhoej.dk> - 2017-07-12 21:02 -0400

csiph-web