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?

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 2017-07-12 17:04 +0000
Organization A noiseless patient Spider
Message-ID <ok5kr7$q3o$2@dont-email.me> (permalink)
References <87lgnu5b9o.fsf@munus.decebal.nl> <ok5auj$3m4$1@dont-email.me>

Show all headers | 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