Re: Impact of code difference in Collection#contains() worth improving?

2014-08-30 Thread Stanimir Simeonoff
Somewhat off topic. The linked implementation of android lacks integer overflow on size. That might be actually irrelevant on android due to OOM happening earlier than integer overflow. The latter that made me check the JDK impl. I know most concurrent collections handle integer overflow (CLQ, CHM

Re: Impact of code difference in Collection#contains() worth improving?

2014-08-30 Thread Doug Lea
Stepping back from this just a little... Potential OpenJDK contributors wonder whether, all other things being equal, they should choose construction A because it is faster than construction B. And they'd like a better answer than "it's complicated". Usually, the answer IS complicated, so it's

Re: Impact of code difference in Collection#contains() worth improving?

2014-08-30 Thread Fabian Lange
Hello dear list, it was not my intention to steal precious developer time by annoying you guys with my finding. I really wanted to understand why there is a source difference. So I went ahead and looked at it from the only aspect I could estimate contributing to it. I am well aware of the fact tha

Re: Impact of code difference in Collection#contains() worth improving?

2014-08-30 Thread Ulf Zibis
Am 29.08.2014 um 23:56 schrieb Martin Buchholz: Just think - one whole byte saved for each individual change! I have a webrev! http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/ https://bugs

Re: Impact of code difference in Collection#contains() worth improving?

2014-08-30 Thread Ulf Zibis
Am 30.08.2014 um 01:33 schrieb John Rose: On Aug 29, 2014, at 1:05 PM, Ulf Zibis mailto:ulf.zi...@cosoco.de>> wrote: Thanks for explaining this, but a very little nit: the immediate (I.e. -1) uses additional 32/64 bits in code which must be loaded from memory and wastes space in CPU cache or a

Re: Replace concat String to append in StringBuilder parameters

2014-08-30 Thread Otávio Gonçalves de Santana
I believe yes. Using the -XX:+OptimizeStringConcat: java -jar -XX:+OptimizeStringConcat target/microbenchmarks.jar ".*StringBuilderConcatBenchMark.*" -wi 10 -i 10 -f 1 The same thing happened: Benchmark Mode Samples Mean Mean errorU

Re: Optimization 2.0 for composing strings - Was: Replace concat String to append in StringBuilder parameters

2014-08-30 Thread Ivan Gerasimov
It may be worth to compare the performance of alternative implementations with -XX:+OptimizeStringConcat option turned on. Sincerely yours, Ivan On 30.08.2014 0:53, Ulf Zibis wrote: Hi compiler people, is there some chance that javac could be enhanced to optimize better as discussed in this