📄 getstatic.java
字号:
package jbe.micro;import jbe.BenchMark;import jbe.Execute;public class GetStatic extends BenchMark { public GetStatic() { stat = 4711; } public static int stat;/* 14: iload_2 15: iload_3 16: iadd 17: getstatic #2; //Field stat:I 20: iadd 21: istore_2*/ public int test(int cnt) { int a = 0; int b = 123; int i; for (i=0; i<cnt; ++i) { a = a+b+stat; } return a; }/* 14: iload_2 15: iload_3 16: iadd 17: istore_2*/ public int overhead(int cnt) { int a = 0; int b = 123; int i; for (i=0; i<cnt; ++i) { a = a+b; } return a; } public String getName() { return "getstatic"; } public static void main(String[] args) { BenchMark bm = new GetStatic(); Execute.perform(bm); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -