• <small id='CpXVu'></small><noframes id='CpXVu'>

      <bdo id='CpXVu'></bdo><ul id='CpXVu'></ul>

      1. <tfoot id='CpXVu'></tfoot>
        <legend id='CpXVu'><style id='CpXVu'><dir id='CpXVu'><q id='CpXVu'></q></dir></style></legend>
        <i id='CpXVu'><tr id='CpXVu'><dt id='CpXVu'><q id='CpXVu'><span id='CpXVu'><b id='CpXVu'><form id='CpXVu'><ins id='CpXVu'></ins><ul id='CpXVu'></ul><sub id='CpXVu'></sub></form><legend id='CpXVu'></legend><bdo id='CpXVu'><pre id='CpXVu'><center id='CpXVu'></center></pre></bdo></b><th id='CpXVu'></th></span></q></dt></tr></i><div id='CpXVu'><tfoot id='CpXVu'></tfoot><dl id='CpXVu'><fieldset id='CpXVu'></fieldset></dl></div>
      2. 避免 jvm 预热

        Avoid jvm warmup(避免 jvm 预热)

        <small id='KNmrT'></small><noframes id='KNmrT'>

      3. <i id='KNmrT'><tr id='KNmrT'><dt id='KNmrT'><q id='KNmrT'><span id='KNmrT'><b id='KNmrT'><form id='KNmrT'><ins id='KNmrT'></ins><ul id='KNmrT'></ul><sub id='KNmrT'></sub></form><legend id='KNmrT'></legend><bdo id='KNmrT'><pre id='KNmrT'><center id='KNmrT'></center></pre></bdo></b><th id='KNmrT'></th></span></q></dt></tr></i><div id='KNmrT'><tfoot id='KNmrT'></tfoot><dl id='KNmrT'><fieldset id='KNmrT'></fieldset></dl></div>
      4. <tfoot id='KNmrT'></tfoot>

          <legend id='KNmrT'><style id='KNmrT'><dir id='KNmrT'><q id='KNmrT'></q></dir></style></legend>

              <bdo id='KNmrT'></bdo><ul id='KNmrT'></ul>
                <tbody id='KNmrT'></tbody>
                  本文介绍了避免 jvm 预热的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果我正在设计排序算法测试,我可以这样做以避免 JVM 预热吗?谢谢!

                  If I am designing a test on sorting algorithm can I do this way to avoid JVM warmup ? Thank you!

                  double count = 0;
                  double start, end;
                  for(int r = 0; r < warmup; r++) {
                      // do test
                  }
                  for(int t = 0; t < runs; t++){
                      start = System.nanoTime();
                      // do test
                      end = System.nanoTime();
                      count += start - end;
                  }
                  double avg = count/avg
                  

                  推荐答案

                  JVM预热通常是指JVM找到热点并JIT这些代码段所花费的时间.如果你实际运行几百次(我相信实际上是几千次)测试,你应该会很好.

                  The JVM warmup usually refers to the time it takes for the JVM to find the hotspots and JIT these sections of the code. If you run your actual tests a few hundred (actually a few thousand I believe) times you should be fairly good to go.

                  但是,您应该知道,即使您这样做,也无法保证.您必须对特定的 JVM 进行试验,以确定在重要部分被 JIT 等之前您需要做多少工作.

                  You should however know that, even if you do this, there are no guarantees. You'll have to experiment with your particular JVM to figure out how much work you have to do before the vital parts is JITed and so on.

                  在这个小案例研究中JIT 编译在 1700 次调用后开始.

                  In this little case study the JIT compilation kicked in after 1700 calls.

                  这篇关于避免 jvm 预热的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                  ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                  How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                  Why a sawtooth shaped graph?(为什么是锯齿形图形?)

                  <small id='5pfgk'></small><noframes id='5pfgk'>

                  • <i id='5pfgk'><tr id='5pfgk'><dt id='5pfgk'><q id='5pfgk'><span id='5pfgk'><b id='5pfgk'><form id='5pfgk'><ins id='5pfgk'></ins><ul id='5pfgk'></ul><sub id='5pfgk'></sub></form><legend id='5pfgk'></legend><bdo id='5pfgk'><pre id='5pfgk'><center id='5pfgk'></center></pre></bdo></b><th id='5pfgk'></th></span></q></dt></tr></i><div id='5pfgk'><tfoot id='5pfgk'></tfoot><dl id='5pfgk'><fieldset id='5pfgk'></fieldset></dl></div>
                    • <bdo id='5pfgk'></bdo><ul id='5pfgk'></ul>
                      <legend id='5pfgk'><style id='5pfgk'><dir id='5pfgk'><q id='5pfgk'></q></dir></style></legend>
                        <tfoot id='5pfgk'></tfoot>

                          <tbody id='5pfgk'></tbody>