This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class Integer | |
| { | |
| public static int bitCount(int i) | |
| { | |
| // HD, Figure 5-2 | |
| i = i - ((i >>> 1) & 0x55555555); | |
| i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); | |
| i = (i + (i >>> 4)) & 0x0f0f0f0f; | |
| i = i + (i >>> 8); | |
| i = i + (i >>> 16); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mov %r11d,%r8d | |
| shr %r8d | |
| and $0x55555555,%r8d | |
| sub %r8d,%r11d ;*isub | |
| ; - java.lang.Integer::bitCount@7 (line 1143) | |
| ; - PopCntTest::main@9 (line 9) | |
| mov %r11d,%r8d | |
| shr $0x2,%r8d | |
| and $0x33333333,%r11d | |
| and $0x33333333,%r8d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| popcnt %r11d,%ebx | |
| add 0x8(%rsi),%ebx ;*iadd | |
| ; - PopCntTest::main@12 (line 9) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PopCntBenchmark extends SimpleBenchmark | |
| { | |
| public int timeIntegerBitCount(int iterations) | |
| { | |
| int result = 0; | |
| for (int i = 0; i < iterations; i++) | |
| { | |
| result += Integer.bitCount(i); | |
| } | |
| return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <fontconfig> | |
| <match target="font"> | |
| <edit name="autohint" mode="assign"> | |
| <bool>true</bool> | |
| </edit> | |
| <edit name="hinting" mode="assign"> | |
| <bool>true</bool> | |
| </edit> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LINKDIR=/usr/bin | |
| JHOME=/usr/java/latest | |
| JREDIR=$JHOME/jre/bin | |
| JDKDIR=$JHOME/bin | |
| sudo alternatives --install $LINKDIR/java java $JREDIR/java 20000 \ | |
| --slave $LINKDIR/keytool keytool $JREDIR/keytool \ | |
| --slave $LINKDIR/orbd orbd $JREDIR/orbd \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.openjdk.jmh.samples; | |
| import org.openjdk.jmh.annotations.Benchmark; | |
| import org.openjdk.jmh.annotations.Scope; | |
| import org.openjdk.jmh.annotations.Setup; | |
| import org.openjdk.jmh.annotations.State; | |
| import org.openjdk.jmh.infra.Blackhole; | |
| import org.openjdk.jmh.runner.Runner; | |
| import org.openjdk.jmh.runner.options.Options; | |
| import org.openjdk.jmh.runner.options.OptionsBuilder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/aeron-driver/src/test/java/uk/co/real_logic/aeron/driver/UdpChannelTest.java b/aeron-driver/src/test/java/uk/co/real_logic/aeron/driver/UdpChannelTest.java | |
| index 32e3814..fb28e8b 100644 | |
| --- a/aeron-driver/src/test/java/uk/co/real_logic/aeron/driver/UdpChannelTest.java | |
| +++ b/aeron-driver/src/test/java/uk/co/real_logic/aeron/driver/UdpChannelTest.java | |
| @@ -22,15 +22,17 @@ import static org.hamcrest.MatcherAssert.assertThat; | |
| import java.net.InetAddress; | |
| import java.net.InetSocketAddress; | |
| import java.net.NetworkInterface; | |
| +import java.net.SocketException; | |
| import java.net.UnknownHostException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RingBuffer<ValueEvent<String>> ringBuffer = new RingBuffer<>(...); | |
| String data = "ABC"; | |
| long next = ringBuffer.next(); | |
| try | |
| { | |
| ValueEvent<String> event = ringBuffer.get(next); | |
| event.set(data); | |
| } | |
| finally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RingBuffer<ValueEvent<String>> ringBuffer = new RingBuffer<>(...); | |
| String data = "ABC"; | |
| ringBuffer.publishEvent((event, seq, arg) -> event.set(arg), data); |