???Java?е???????
???????????? ???????[ 2015/1/6 11:13:44 ] ????????Java ???????
?????????????????????????????????
??????????е????????????????????????????????? instanceof ??????????????????????????????????????????????????磬????????????????NavieArray???ú????????????
public int compute() {
if(array instanceof NaiveArray) {
int[] back = ((NaiveArray) array).array;
for(int k = 0; k < back.length; ++k)
back[k] = k;
int sum = 0;
for(int k = 0; k < back.length; ++k)
sum += back[k];
return sum;
}
//...
}
|
????????????????????????????????????????ε??????…… ???????????????????????????????????
??????????????????benchmarking???????????????????
???????
?????ЩJava?汾???????????????????????????????????????????????????????????????????
????????????? final ????????????????????
??????????????????????е?????????????????????????????????????á???? instanceof ?????????????Щ????????д?????????????????????????
????????
????Erich Schubert??? double ???????м???benchmark???????????н???????????ì???????????????????????????????????μ??°汾??OpenJDK????????????????????????????10????????????????????
???????????????????°汾??OpenJDK???????????????????????????????1.8.0_40)??????????????????????JDK????????????? ??????????????????????????????????????????????????????????磬JDK????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11