???????????

??????Щ??????????????????в????LinkedList???????????????????????????????????????????н????????????????????????????????????????????????????????????????LinkedList??ArrayList?????????????????????

??????????????????????????С?????????λ?t?????????????λ??????????????м??????????????????????????л??????????????????????????λ?????????????β???м???????????????С???е??100?????????????10??000???????????????1??000??000????????

??????????????У?????????JAVA SDK 1.2.0??1.3.0??е?SUN JVM???????????HOTSPOT JVM 2.0??????????????汾??????1.3.0 SDK???????????????У??????????????????????????SDK 1.2 VM?????????????????????????????????????????????????JVM?????????????JIT??????????????JVM?????????????????????????????????????м??????????β????????????????????????????????β??????????????????????????????μ????????????????飩??????????????????????????????г?????κβ??????????????????????????????????????????????????????????????????????????????У??????????????????????? ??1??????????е??С??????100?????????????е????????????????С??????
 
??

??1??????????е??С??????100?????????????е????????????????С??????

??

1.2 JVM

1.3 JVM

HotSpot 2.0 JVM

???????ArrayList????

(48.0%)

184.9% (152.0%)

108.0% (66.7%)

???????LinkedList????

135.5%

109.1%

85.3%

???????ArrayList???м?

130.0% (40.6%)

187.4% (158.0%)

84.7% (46.0%)

???????LinkedList???м?

174.0%

135.0%

102.3%

???????ArrayList???β

63.3% (20.7%)

65.9% (25.0%)

60.3% (29.3%)

???????LinkedList???β

106.7%

86.3%

80.3%

????????С??????ArrayList??LinkedList?????????????????????????β??????????????ArrayList???????????????????????????ArrayList?????????????????????????????????????С?????????Java???饗????Object[]?????κμ?????????и??????????????????????????????????????????????????????JVM???????????????????????????

???????磬??????????????????λ?????????1??????У???HotSpot 2.0 JVM??LinkedList???к???????85.3%??????????λ???? 1.2 JVM??ArrayList??????????????????????1.2?м???JIT??????????е???????????????????????к???Ч?????HotSpot?и????JVM?????????????????????????????????????????????????LinkedList??????????????????????code-inlining?????????1.3 JVM??????????????????????????????????????????????????????????JVM?汾?е???????

?????????????????в??????ArrayList?????LinkedList???????????????????????С????????????????????ArrayList?????????????????????С?????磬???????ArrayList???????????100???????????????????????????????????????????????????????1?????е?????????????????????С????????????LinkedList????? SDK 1.3??????????????С??

????????ArrayList??????????????????????????????????????????????????????????????ArrayList??????????????????????????????????????LinkedList????????????κ?????????????????????????????????????????LinkedList?????????????????????????????????Щ??????????κ???С??????????????????ArrayList??????LinkedList?? ??2?????????????????10??000??????

??

??2?????????????????10??000??????

??

1.2 JVM

1.3 JVM

HotSpot 2.0 JVM

???????ArrayList????

7773%

7537%

7500%

???????LinkedList????

90.34%

65.6%

???????ArrayList???м?

3318%

3412%

3121%

???????LinkedList???м?

26264%

14315%

14209%

???????ArrayList???β

41.4%

41.2%

37.5%

???????LinkedList???β

66.4%

73.9%

61.7%

??2????????????????????????????????????????????????????????????????????????????????????????????????????????????LinkedList?????????γ?????????????????м???????????????????????????ArrayList?????????????????????????????LinkedList??????????????м??????????Щ???????????????????????????????ArrayList?м??????????????

????????????ArrayList????????????????±?????????????????????????????????????λ??????Ρ????????????????????????п????λ???LinkedList???и??????????????????????????????????ArrayList??????????????????????????????????????[size -index]??????????????е?λ?á? ??3????????????????1??000??000??????

??

??3????????????????1??000??000??????

??

1.2 JVM

1.3 JVM

HotSpot 2.0 JVM

???????ArrayList????

???

???

???

???????LinkedList????

179.5%

144.1%

???????ArrayList???м?

???

???

???

???????LinkedList???м?

???

???

???

???????ArrayList???β

38.3%

47.7%

42.9%

???????LinkedList???β

65.1%

161.5%

139.9%

??3?????????????????????????ó?????????2???????????????3???????????????????????????????????????????????????????