• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CompilerControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openjdk.jmh.annotations.CompilerControl的典型用法代码示例。如果您正苦于以下问题:Java CompilerControl类的具体用法?Java CompilerControl怎么用?Java CompilerControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CompilerControl类属于org.openjdk.jmh.annotations包,在下文中一共展示了CompilerControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Unrolled

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public int Unrolled(HashCodeData state) {
    int[] a = state.data;
    if (a == null)
        return 0;

    int result = 1;
    int i = 0;
    for (; i + 3 < a.length; i += 4) {
        result = 31 * 31 * 31 * 31 * result
               + 31 * 31 * 31 * a[i]
               + 31 * 31 * a[i + 1]
               + 31 * a[i + 2]
               + a[i + 3];
    }
    for (; i < a.length; i++) {
        result = 31 * result + a[i];
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:22,代码来源:HashCode.java


示例2: PopCount_Unrolled4

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public long PopCount_Unrolled4(LongData state) {
    long popCnt = 0L;
    long[] data = state.data1;
    int i = 0;
    for (; i + 3 < data.length; i += 4) {
        popCnt = popCnt
               + Long.bitCount(data[i])
               + Long.bitCount(data[i + 1])
               + Long.bitCount(data[i + 2])
               + Long.bitCount(data[i + 3]);
    }
    for (; i < data.length; ++i) {
        popCnt += Long.bitCount(data[i]);
    }
    return popCnt;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:19,代码来源:PopCount.java


示例3: PopCount_Unrolled8

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public long PopCount_Unrolled8(LongData state) {
    long popCnt = 0L;
    long[] data = state.data1;
    int i = 0;
    for (; i + 7 < data.length; i += 8) {
        popCnt = popCnt
                + Long.bitCount(data[i])
                + Long.bitCount(data[i + 1])
                + Long.bitCount(data[i + 2])
                + Long.bitCount(data[i + 3])
                + Long.bitCount(data[i + 4])
                + Long.bitCount(data[i + 5])
                + Long.bitCount(data[i + 6])
                + Long.bitCount(data[i + 7]);
    }
    for (; i < data.length; ++i) {
        popCnt += Long.bitCount(data[i]);
    }
    return popCnt;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:23,代码来源:PopCount.java


示例4: hashLoopSplit

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE) //makes looking at assembly easier
public int[] hashLoopSplit(Context context)
{
    for (int i = 0; i < SIZE; i++) {
        context.results[i] = getHashPosition1(context.values[i]);
    }

    for (int i = 0; i < SIZE; i++) {
        context.results[i] = getHashPosition2(context.results[i]);
    }

    for (int i = 0; i < SIZE; i++) {
        context.results[i] = getHashPosition3(context.results[i], 1048575);
    }

    return context.results;
}
 
开发者ID:pnowojski,项目名称:simd-blog,代码行数:19,代码来源:BenchmarkSIMDBlog.java


示例5: pushWithoutJit

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(org.openjdk.jmh.annotations.CompilerControl.Mode.EXCLUDE)
public long pushWithoutJit() {
    Reader reader = new Reader(MAX, _nulls);
    PushConsumer consumer = new PushConsumer();
    for (int i = 0; i < reader.getMax(); i++) {
        boolean nextIsNull = reader.nextIsNull();
        if (nextIsNull) {
            consumer.consumeNull();
        } else {
            consumer.consume(reader.readNext());
        }
    }
    assertThat(consumer.getSum()).isEqualTo(4950000000000000L);
    assertThat(consumer.getNullCount()).isEqualTo(1000000);
    return consumer.getSum();
}
 
开发者ID:jzillmann,项目名称:gradle-jmh-report,代码行数:18,代码来源:PullPushBenchmark.java


示例6: generateImport

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
private void generateImport(PrintWriter writer) {
    Class<?>[] imports = new Class<?>[]{
            List.class, AtomicInteger.class,
            Collection.class, ArrayList.class,
            TimeUnit.class, Generated.class, CompilerControl.class,
            InfraControl.class, ThreadParams.class,
            Result.class, ThroughputResult.class, AverageTimeResult.class,
            SampleTimeResult.class, SingleShotResult.class, SampleBuffer.class,
            Mode.class, Fork.class, Measurement.class, Threads.class, Warmup.class,
            BenchmarkMode.class, RawResults.class, ResultRole.class,
            Field.class, BenchmarkParams.class, IterationParams.class
    };

    for (Class<?> c : imports) {
        writer.println("import " + c.getName() + ';');
    }
    writer.println();
}
 
开发者ID:msteindorfer,项目名称:jmh,代码行数:19,代码来源:BenchmarkGenerator.java


示例7: Mismatch_Handwritten

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void Mismatch_Handwritten(BytePrefixData data, Blackhole bh) {
    byte[] data1 = data.data1;
    byte[] data2 = data.data2;
    int length = Math.min(data1.length, data2.length);
    int mismatch = -1;
    for (int i = 0; i < length; ++i) {
        if (data1[i] != data2[i]) {
            mismatch = i;
            break;
        }
    }
    bh.consume(mismatch);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:16,代码来源:ByteArrayMismatch.java


示例8: impl

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
private int[] impl(int[] data) {
    int[] result = new int[data.length];
    for (int i = 1; i < result.length; ++i) {
        result[i] = result[i - 1] + data[i];
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:9,代码来源:PrefixSum.java


示例9: BranchyCopyAndMask

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public double[] BranchyCopyAndMask(ArrayWithNegatives state) {
    double[] data = state.data;
    double[] result = state.target;
    System.arraycopy(data, 0, result, 0, data.length);
    for (int i = 0; i < result.length; ++i) {
        if (result[i] < 0D) {
            result[i] = 0D;
        }
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:14,代码来源:PositiveValues.java


示例10: BranchyNewArray

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public double[] BranchyNewArray(ArrayWithNegatives state) {
    double[] data = state.data;
    double[] result = state.target;
    for (int i = 0; i < result.length; ++i) {
        result[i] = data[i] < 0D ? 0D : data[i];
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:PositiveValues.java


示例11: NewArray

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public double[] NewArray(ArrayWithNegatives state) {
    double[] data = state.data;
    double[] result = state.target;
    for (int i = 0; i < result.length; ++i) {
        result[i] = Math.max(data[i], 0D);
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:PositiveValues.java


示例12: CopyAndMask

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public double[] CopyAndMask(ArrayWithNegatives state) {
    double[] data = state.data;
    double[] result = state.target;
    System.arraycopy(data, 0, result, 0, data.length);
    for (int i = 0; i < result.length; ++i) {
        result[i] = Math.max(result[i], 0D);
    }
    return result;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:12,代码来源:PositiveValues.java


示例13: Add_Doubles

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void Add_Doubles(DoubleData d, Blackhole bh) {
    double[] data1 = d.data1;
    double[] data2 = d.data2;
    double[] result = new double[data1.length];
    for (int i = 0; i < data1.length; ++i) {
        result[i] = data1[i] + data2[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:12,代码来源:Addition.java


示例14: Add_Floats

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void Add_Floats(FloatData d, Blackhole bh) {
    float[] data1 = d.data1;
    float[] data2 = d.data2;
    float[] result = new float[data1.length];
    for (int i = 0; i < data1.length; ++i) {
        result[i] = data1[i] + data2[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:12,代码来源:Addition.java


示例15: Add_Ints

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void Add_Ints(IntData d, Blackhole bh) {
    int[] data1 = d.data1;
    int[] data2 = d.data2;
    int[] result = new int[data1.length];
    for (int i = 0; i < data1.length; ++i) {
        result[i] = data1[i] + data2[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:12,代码来源:Addition.java


示例16: Add_Longs

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void Add_Longs(LongData d, Blackhole bh) {
    long[] data1 = d.data1;
    long[] data2 = d.data2;
    long[] result = new long[data1.length];
    for (int i = 0; i < data1.length; ++i) {
        result[i] = data1[i] + data2[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:12,代码来源:Addition.java


示例17: PopCount

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public long PopCount(LongData state) {
    long popCnt = 0L;
    long[] data = state.data1;
    for (int i = 0; i < data.length; ++i) {
        popCnt += Long.bitCount(data[i]);
    }
    return popCnt;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:PopCount.java


示例18: PopCountInt

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public int PopCountInt(IntData state) {
    int popCnt = 0;
    int[] data = state.data1;
    for (int i = 0; i < data.length; ++i) {
        popCnt += Integer.bitCount(data[i]);
    }
    return popCnt;
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:PopCount.java


示例19: SS_Doubles

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void SS_Doubles(DoubleData d, Blackhole bh) {
    double[] data = d.data1;
    double result = 0D;
    for (int i = 0; i < data.length; ++i) {
        result += data[i] * data[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:SumOfSquares.java


示例20: SS_Floats

import org.openjdk.jmh.annotations.CompilerControl; //导入依赖的package包/类
@Benchmark
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
public void SS_Floats(FloatData d, Blackhole bh) {
    float[] data = d.data1;
    float result = 0F;
    for (int i = 0; i < data.length; ++i) {
        result += data[i] * data[i];
    }
    bh.consume(result);
}
 
开发者ID:richardstartin,项目名称:simdbenchmarks,代码行数:11,代码来源:SumOfSquares.java



注:本文中的org.openjdk.jmh.annotations.CompilerControl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Builder类代码示例发布时间:2022-05-21
下一篇:
Java XYLayout类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap