Approved!
There was a lot of benchmarking work, so I'd like to see the jmh benchmark
checked in.
Especially since the exact variant we eventually settled on is not in
Hacker's Delight.
On Mon, Aug 13, 2018 at 12:09 PM, Ivan Gerasimov
wrote:
> Okay, your last variant is the winner :)
>
> Here's
Okay, your last variant is the winner :)
Here's the updated webrev, benchmark and the graphs:
http://cr.openjdk.java.net/~igerasim/8209171/02/webrev/
http://cr.openjdk.java.net/~igerasim/8209171/02/bench/int/MyBenchmark.java
http://cr.openjdk.java.net/~igerasim/8209171/02/bench/int/bench-int-04-
On Mon, Aug 13, 2018 at 10:10 AM, Ivan Gerasimov
wrote:
> Hi Martin!
>
> Good point about the command line flags, thanks!
>
> These variants are close to numberOfTrailingZeros_07 that I've already
> tested, though you did better by saving one arithmetic operation at the
> return line!
>
>
Right.
Hi Martin!
Good point about the command line flags, thanks!
These variants are close to numberOfTrailingZeros_07 that I've already
tested, though you did better by saving one arithmetic operation at the
return line!
I'll rerun the benchmarks.
With kind regards,
Ivan
On 8/13/18 7:56 AM, M
The number of plausible variants is astonishing!
---
Your use of -client and -server is outdated, which explains why you get the
same results for both (-client is ignored).
I'm not sure what's blessed by hotspot team, but for C1 I
use -XX:+TieredCompilation -XX:TieredStopAtLevel=1 and for C2 I
On 8/12/18 10:57 AM, Martin Buchholz wrote:
If delegating to nlz is the winner so far, we should be able to do at
least as well by inlining nlz into ntz and then looking for more
optimizations. Following this strategy leads naturally to
static int ntz_inlineNlz2(int i) {
i &= -i;
Here's an example of a microbenchmark that uses multiple random inputs
simulating various typical populations:
https://github.com/google/caliper/blob/master/caliper-examples/src/main/java/examples/Utf8Benchmark.java
If delegating to nlz is the winner so far, we should be able to do at least
as well by inlining nlz into ntz and then looking for more optimizations.
Following this strategy leads naturally to
static int ntz_inlineNlz2(int i) {
i &= -i;
if (i <= 0) return 32 - (i >>> 31);
Hi Martin!
On 8/11/18 5:54 PM, Martin Buchholz wrote:
Hi Ivan,
Oh the allure of bit-twiddling!
Yes :)
I'm skeptical that ntz should ever delegate to nlz, and not only
because of the overhead of a wrapper, but because small numbers are
more common, and we can take that into account when im
Hi Ivan,
Oh the allure of bit-twiddling!
I'm skeptical that ntz should ever delegate to nlz, and not only because of
the overhead of a wrapper, but because small numbers are more common, and
we can take that into account when implementing ntz. At least add "1" to
the set of numbers to benchmark.
Thanks Martin!
On 8/9/18 5:42 PM, Martin Buchholz wrote:
On Thu, Aug 9, 2018 at 5:27 PM, Ivan Gerasimov
mailto:ivan.gerasi...@oracle.com>> wrote:
I did not use the intrinsified variants of numberOfLeadingZeros in
the benchmark.
Oops! Should have looked more closely!
Did you know
On Thu, Aug 9, 2018 at 5:27 PM, Ivan Gerasimov
wrote:
> I did not use the intrinsified variants of numberOfLeadingZeros in the
> benchmark.
>
Oops! Should have looked more closely!
Did you know about
http://www.hackersdelight.org/hdcodetxt/ntz.c.txt
Hi Martin!
Thanks for taking a look!
On 8/9/18 5:13 PM, Martin Buchholz wrote:
On Thu, Aug 9, 2018 at 4:15 PM, Ivan Gerasimov
mailto:ivan.gerasi...@oracle.com>> wrote:
Hello!
Integer.numberOfTrailingZeros() and Long.numberOfTrailingZeros()
are intrinsified by Hotspot, so the
On Thu, Aug 9, 2018 at 4:15 PM, Ivan Gerasimov
wrote:
> Hello!
>
> Integer.numberOfTrailingZeros() and Long.numberOfTrailingZeros() are
> intrinsified by Hotspot, so the Java implementation of these is not too
> important.
> However, they still can be improved by a tiny bit :)
>
> Could you pleas
Hi Joe!
On 8/9/18 4:20 PM, Joseph D. Darcy wrote:
Hi Ivan,
On which platforms were the benchmark numbers collected?
Ah, yes, should have mentioned that.
macOS 10.13.5 High Sierra, processor 3.1 GHz Intel Core i7
With kind regards,
Ivan
Thanks,
-Joe
On 8/9/2018 4:15 PM, Ivan Gerasimov wr
Hi Ivan,
On which platforms were the benchmark numbers collected?
Thanks,
-Joe
On 8/9/2018 4:15 PM, Ivan Gerasimov wrote:
Hello!
Integer.numberOfTrailingZeros() and Long.numberOfTrailingZeros() are
intrinsified by Hotspot, so the Java implementation of these is not
too important.
However,
16 matches
Mail list logo