Created
October 9, 2016 11:44
-
-
Save Atry/3dc5d09d82fc6d88af590b35db9b7d97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> def test(size: Int, iterations: Int): Unit = { | |
| println(s"size of the list: $size") | |
| println(s"number of iterations: $iterations") | |
| val list = (0 until size).toList | |
| @volatile var dontOptimizeMe: Any = 0 | |
| def bufferReverseIterator[A](list: List[A]) = { | |
| list.toBuffer.reverseIterator | |
| } | |
| def arrayReverseIterator[A](list: List[A]) = { | |
| val array = new Array[Any](list.size) | |
| list.copyToArray[Any](array, 0) | |
| array.reverseIterator.asInstanceOf[Iterator[A]] | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| bufferReverseIterator(list) | |
| } | |
| println(s"bufferReverseIterator(list) takes: ${System.nanoTime - start} nanoseconds") | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| arrayReverseIterator(list) | |
| } | |
| println(s"arrayReverseIterator(list) takes: ${System.nanoTime - start} nanoseconds") | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| list.reverseIterator | |
| } | |
| println(s"list.reverseIterator takes: ${System.nanoTime - start} nanoseconds") | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| for (i <- bufferReverseIterator(list)) { dontOptimizeMe = i } | |
| } | |
| println(s"bufferReverseIterator(list).foreach takes:${System.nanoTime - start} nanoseconds") | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| for (i <- arrayReverseIterator(list)) { dontOptimizeMe = i } | |
| } | |
| println(s"arrayReverseIterator(list).foreach takes: ${System.nanoTime - start} nanoseconds") | |
| } | |
| System.gc(); | |
| { | |
| val start = System.nanoTime | |
| for (_ <- 0 until iterations) { | |
| for (i <- list.reverseIterator) { dontOptimizeMe = i } | |
| } | |
| println(s"list.reverseIterator.foreach takes: ${System.nanoTime - start} nanoseconds") | |
| } | |
| println() | |
| } | |
test: (size: Int, iterations: Int)Unit | |
scala> | |
scala> for (_ <- 0 until 5) { | |
| test(1, 1000000) | |
| test(3, 1000000) | |
| test(5, 1000000) | |
| test(8, 1000000) | |
| test(10, 100000) | |
| test(100, 10000) | |
| test(1000, 1000) | |
| test(10000, 100) | |
| test(100000, 10) | |
| } | |
size of the list: 1 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 174855857 nanoseconds | |
arrayReverseIterator(list) takes: 41472345 nanoseconds | |
list.reverseIterator takes: 19815228 nanoseconds | |
bufferReverseIterator(list).foreach takes:202236053 nanoseconds | |
arrayReverseIterator(list).foreach takes: 46893330 nanoseconds | |
list.reverseIterator.foreach takes: 29540813 nanoseconds | |
size of the list: 3 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 194149051 nanoseconds | |
arrayReverseIterator(list) takes: 45341670 nanoseconds | |
list.reverseIterator takes: 34004494 nanoseconds | |
bufferReverseIterator(list).foreach takes:211733329 nanoseconds | |
arrayReverseIterator(list).foreach takes: 62756134 nanoseconds | |
list.reverseIterator.foreach takes: 68122346 nanoseconds | |
size of the list: 5 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 210098926 nanoseconds | |
arrayReverseIterator(list) takes: 57467891 nanoseconds | |
list.reverseIterator takes: 55909910 nanoseconds | |
bufferReverseIterator(list).foreach takes:268329125 nanoseconds | |
arrayReverseIterator(list).foreach takes: 84578711 nanoseconds | |
list.reverseIterator.foreach takes: 128905843 nanoseconds | |
size of the list: 8 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 272533791 nanoseconds | |
arrayReverseIterator(list) takes: 67089580 nanoseconds | |
list.reverseIterator takes: 74117661 nanoseconds | |
bufferReverseIterator(list).foreach takes:326930232 nanoseconds | |
arrayReverseIterator(list).foreach takes: 114063173 nanoseconds | |
list.reverseIterator.foreach takes: 199986404 nanoseconds | |
size of the list: 10 | |
number of iterations: 100000 | |
bufferReverseIterator(list) takes: 26356464 nanoseconds | |
arrayReverseIterator(list) takes: 7350043 nanoseconds | |
list.reverseIterator takes: 9823832 nanoseconds | |
bufferReverseIterator(list).foreach takes:36330390 nanoseconds | |
arrayReverseIterator(list).foreach takes: 15694120 nanoseconds | |
list.reverseIterator.foreach takes: 25269669 nanoseconds | |
size of the list: 100 | |
number of iterations: 10000 | |
bufferReverseIterator(list) takes: 11885760 nanoseconds | |
arrayReverseIterator(list) takes: 6302953 nanoseconds | |
list.reverseIterator takes: 8923862 nanoseconds | |
bufferReverseIterator(list).foreach takes:20488847 nanoseconds | |
arrayReverseIterator(list).foreach takes: 12843476 nanoseconds | |
list.reverseIterator.foreach takes: 26105719 nanoseconds | |
size of the list: 1000 | |
number of iterations: 1000 | |
bufferReverseIterator(list) takes: 10844023 nanoseconds | |
arrayReverseIterator(list) takes: 6509780 nanoseconds | |
list.reverseIterator takes: 10834161 nanoseconds | |
bufferReverseIterator(list).foreach takes:23674126 nanoseconds | |
arrayReverseIterator(list).foreach takes: 17042706 nanoseconds | |
list.reverseIterator.foreach takes: 25653393 nanoseconds | |
size of the list: 10000 | |
number of iterations: 100 | |
bufferReverseIterator(list) takes: 10183635 nanoseconds | |
arrayReverseIterator(list) takes: 6856502 nanoseconds | |
list.reverseIterator takes: 9158417 nanoseconds | |
bufferReverseIterator(list).foreach takes:20950246 nanoseconds | |
arrayReverseIterator(list).foreach takes: 16765812 nanoseconds | |
list.reverseIterator.foreach takes: 24348130 nanoseconds | |
size of the list: 100000 | |
number of iterations: 10 | |
bufferReverseIterator(list) takes: 9750382 nanoseconds | |
arrayReverseIterator(list) takes: 7271596 nanoseconds | |
list.reverseIterator takes: 8929995 nanoseconds | |
bufferReverseIterator(list).foreach takes:20820468 nanoseconds | |
arrayReverseIterator(list).foreach takes: 18208732 nanoseconds | |
list.reverseIterator.foreach takes: 26875218 nanoseconds | |
size of the list: 1 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 188383285 nanoseconds | |
arrayReverseIterator(list) takes: 39879681 nanoseconds | |
list.reverseIterator takes: 17886291 nanoseconds | |
bufferReverseIterator(list).foreach takes:172793332 nanoseconds | |
arrayReverseIterator(list).foreach takes: 38163097 nanoseconds | |
list.reverseIterator.foreach takes: 26460675 nanoseconds | |
size of the list: 3 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 212103770 nanoseconds | |
arrayReverseIterator(list) takes: 46455473 nanoseconds | |
list.reverseIterator takes: 41463308 nanoseconds | |
bufferReverseIterator(list).foreach takes:221208230 nanoseconds | |
arrayReverseIterator(list).foreach takes: 64458056 nanoseconds | |
list.reverseIterator.foreach takes: 71183328 nanoseconds | |
size of the list: 5 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 220933409 nanoseconds | |
arrayReverseIterator(list) takes: 54935092 nanoseconds | |
list.reverseIterator takes: 52206895 nanoseconds | |
bufferReverseIterator(list).foreach takes:261253107 nanoseconds | |
arrayReverseIterator(list).foreach takes: 84560025 nanoseconds | |
list.reverseIterator.foreach takes: 124406361 nanoseconds | |
size of the list: 8 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 270208378 nanoseconds | |
arrayReverseIterator(list) takes: 65104594 nanoseconds | |
list.reverseIterator takes: 75596493 nanoseconds | |
bufferReverseIterator(list).foreach takes:327397870 nanoseconds | |
arrayReverseIterator(list).foreach takes: 117323548 nanoseconds | |
list.reverseIterator.foreach takes: 202474971 nanoseconds | |
size of the list: 10 | |
number of iterations: 100000 | |
bufferReverseIterator(list) takes: 26716042 nanoseconds | |
arrayReverseIterator(list) takes: 7686660 nanoseconds | |
list.reverseIterator takes: 8798744 nanoseconds | |
bufferReverseIterator(list).foreach takes:36123761 nanoseconds | |
arrayReverseIterator(list).foreach takes: 16405913 nanoseconds | |
list.reverseIterator.foreach takes: 27598266 nanoseconds | |
size of the list: 100 | |
number of iterations: 10000 | |
bufferReverseIterator(list) takes: 11198470 nanoseconds | |
arrayReverseIterator(list) takes: 4722308 nanoseconds | |
list.reverseIterator takes: 10937640 nanoseconds | |
bufferReverseIterator(list).foreach takes:19403868 nanoseconds | |
arrayReverseIterator(list).foreach takes: 12686486 nanoseconds | |
list.reverseIterator.foreach takes: 27342068 nanoseconds | |
size of the list: 1000 | |
number of iterations: 1000 | |
bufferReverseIterator(list) takes: 10983346 nanoseconds | |
arrayReverseIterator(list) takes: 5623274 nanoseconds | |
list.reverseIterator takes: 8549979 nanoseconds | |
bufferReverseIterator(list).foreach takes:19952710 nanoseconds | |
arrayReverseIterator(list).foreach takes: 17425391 nanoseconds | |
list.reverseIterator.foreach takes: 26188019 nanoseconds | |
size of the list: 10000 | |
number of iterations: 100 | |
bufferReverseIterator(list) takes: 10734670 nanoseconds | |
arrayReverseIterator(list) takes: 8189063 nanoseconds | |
list.reverseIterator takes: 12355468 nanoseconds | |
bufferReverseIterator(list).foreach takes:19983488 nanoseconds | |
arrayReverseIterator(list).foreach takes: 19626841 nanoseconds | |
list.reverseIterator.foreach takes: 26387364 nanoseconds | |
size of the list: 100000 | |
number of iterations: 10 | |
bufferReverseIterator(list) takes: 11617435 nanoseconds | |
arrayReverseIterator(list) takes: 6950086 nanoseconds | |
list.reverseIterator takes: 8845756 nanoseconds | |
bufferReverseIterator(list).foreach takes:24691744 nanoseconds | |
arrayReverseIterator(list).foreach takes: 18843620 nanoseconds | |
list.reverseIterator.foreach takes: 25329477 nanoseconds | |
size of the list: 1 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 187757219 nanoseconds | |
arrayReverseIterator(list) takes: 37485727 nanoseconds | |
list.reverseIterator takes: 18939197 nanoseconds | |
bufferReverseIterator(list).foreach takes:194322220 nanoseconds | |
arrayReverseIterator(list).foreach takes: 40754916 nanoseconds | |
list.reverseIterator.foreach takes: 24451839 nanoseconds | |
size of the list: 3 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 210875642 nanoseconds | |
arrayReverseIterator(list) takes: 45519862 nanoseconds | |
list.reverseIterator takes: 37339304 nanoseconds | |
bufferReverseIterator(list).foreach takes:230929629 nanoseconds | |
arrayReverseIterator(list).foreach takes: 57410001 nanoseconds | |
list.reverseIterator.foreach takes: 69609362 nanoseconds | |
size of the list: 5 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 203489323 nanoseconds | |
arrayReverseIterator(list) takes: 50971796 nanoseconds | |
list.reverseIterator takes: 56751364 nanoseconds | |
bufferReverseIterator(list).foreach takes:263803093 nanoseconds | |
arrayReverseIterator(list).foreach takes: 84028367 nanoseconds | |
list.reverseIterator.foreach takes: 117921380 nanoseconds | |
size of the list: 8 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 271194396 nanoseconds | |
arrayReverseIterator(list) takes: 66762813 nanoseconds | |
list.reverseIterator takes: 80841500 nanoseconds | |
bufferReverseIterator(list).foreach takes:331610333 nanoseconds | |
arrayReverseIterator(list).foreach takes: 118239144 nanoseconds | |
list.reverseIterator.foreach takes: 204438762 nanoseconds | |
size of the list: 10 | |
number of iterations: 100000 | |
bufferReverseIterator(list) takes: 26007315 nanoseconds | |
arrayReverseIterator(list) takes: 6739659 nanoseconds | |
list.reverseIterator takes: 8783484 nanoseconds | |
bufferReverseIterator(list).foreach takes:35296326 nanoseconds | |
arrayReverseIterator(list).foreach takes: 14086558 nanoseconds | |
list.reverseIterator.foreach takes: 24602002 nanoseconds | |
size of the list: 100 | |
number of iterations: 10000 | |
bufferReverseIterator(list) takes: 12097493 nanoseconds | |
arrayReverseIterator(list) takes: 5262825 nanoseconds | |
list.reverseIterator takes: 8078651 nanoseconds | |
bufferReverseIterator(list).foreach takes:19318665 nanoseconds | |
arrayReverseIterator(list).foreach takes: 12565376 nanoseconds | |
list.reverseIterator.foreach takes: 26273612 nanoseconds | |
size of the list: 1000 | |
number of iterations: 1000 | |
bufferReverseIterator(list) takes: 9838120 nanoseconds | |
arrayReverseIterator(list) takes: 7824654 nanoseconds | |
list.reverseIterator takes: 9464605 nanoseconds | |
bufferReverseIterator(list).foreach takes:21496763 nanoseconds | |
arrayReverseIterator(list).foreach takes: 14363064 nanoseconds | |
list.reverseIterator.foreach takes: 26930696 nanoseconds | |
size of the list: 10000 | |
number of iterations: 100 | |
bufferReverseIterator(list) takes: 11050220 nanoseconds | |
arrayReverseIterator(list) takes: 6522893 nanoseconds | |
list.reverseIterator takes: 8430131 nanoseconds | |
bufferReverseIterator(list).foreach takes:19623993 nanoseconds | |
arrayReverseIterator(list).foreach takes: 16142320 nanoseconds | |
list.reverseIterator.foreach takes: 25828140 nanoseconds | |
size of the list: 100000 | |
number of iterations: 10 | |
bufferReverseIterator(list) takes: 10074410 nanoseconds | |
arrayReverseIterator(list) takes: 7540301 nanoseconds | |
list.reverseIterator takes: 9593498 nanoseconds | |
bufferReverseIterator(list).foreach takes:19293081 nanoseconds | |
arrayReverseIterator(list).foreach takes: 17157030 nanoseconds | |
list.reverseIterator.foreach takes: 26001760 nanoseconds | |
size of the list: 1 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 176010819 nanoseconds | |
arrayReverseIterator(list) takes: 36192538 nanoseconds | |
list.reverseIterator takes: 17868156 nanoseconds | |
bufferReverseIterator(list).foreach takes:194470433 nanoseconds | |
arrayReverseIterator(list).foreach takes: 39256299 nanoseconds | |
list.reverseIterator.foreach takes: 24296468 nanoseconds | |
size of the list: 3 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 193053139 nanoseconds | |
arrayReverseIterator(list) takes: 42850904 nanoseconds | |
list.reverseIterator takes: 34821157 nanoseconds | |
bufferReverseIterator(list).foreach takes:202044423 nanoseconds | |
arrayReverseIterator(list).foreach takes: 57180190 nanoseconds | |
list.reverseIterator.foreach takes: 66949660 nanoseconds | |
size of the list: 5 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 204369858 nanoseconds | |
arrayReverseIterator(list) takes: 51089551 nanoseconds | |
list.reverseIterator takes: 53772197 nanoseconds | |
bufferReverseIterator(list).foreach takes:269983462 nanoseconds | |
arrayReverseIterator(list).foreach takes: 88361991 nanoseconds | |
list.reverseIterator.foreach takes: 131711297 nanoseconds | |
size of the list: 8 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 269878413 nanoseconds | |
arrayReverseIterator(list) takes: 67998374 nanoseconds | |
list.reverseIterator takes: 88255171 nanoseconds | |
bufferReverseIterator(list).foreach takes:341338112 nanoseconds | |
arrayReverseIterator(list).foreach takes: 128854711 nanoseconds | |
list.reverseIterator.foreach takes: 205440673 nanoseconds | |
size of the list: 10 | |
number of iterations: 100000 | |
bufferReverseIterator(list) takes: 26840678 nanoseconds | |
arrayReverseIterator(list) takes: 6593089 nanoseconds | |
list.reverseIterator takes: 9643990 nanoseconds | |
bufferReverseIterator(list).foreach takes:36714588 nanoseconds | |
arrayReverseIterator(list).foreach takes: 15380278 nanoseconds | |
list.reverseIterator.foreach takes: 24874349 nanoseconds | |
size of the list: 100 | |
number of iterations: 10000 | |
bufferReverseIterator(list) takes: 12660943 nanoseconds | |
arrayReverseIterator(list) takes: 5047210 nanoseconds | |
list.reverseIterator takes: 9576575 nanoseconds | |
bufferReverseIterator(list).foreach takes:20291546 nanoseconds | |
arrayReverseIterator(list).foreach takes: 12290311 nanoseconds | |
list.reverseIterator.foreach takes: 23470553 nanoseconds | |
size of the list: 1000 | |
number of iterations: 1000 | |
bufferReverseIterator(list) takes: 10213475 nanoseconds | |
arrayReverseIterator(list) takes: 6299771 nanoseconds | |
list.reverseIterator takes: 9729497 nanoseconds | |
bufferReverseIterator(list).foreach takes:21069976 nanoseconds | |
arrayReverseIterator(list).foreach takes: 16712437 nanoseconds | |
list.reverseIterator.foreach takes: 28167512 nanoseconds | |
size of the list: 10000 | |
number of iterations: 100 | |
bufferReverseIterator(list) takes: 10663446 nanoseconds | |
arrayReverseIterator(list) takes: 8282276 nanoseconds | |
list.reverseIterator takes: 8901007 nanoseconds | |
bufferReverseIterator(list).foreach takes:20660625 nanoseconds | |
arrayReverseIterator(list).foreach takes: 18918089 nanoseconds | |
list.reverseIterator.foreach takes: 25221398 nanoseconds | |
size of the list: 100000 | |
number of iterations: 10 | |
bufferReverseIterator(list) takes: 9820963 nanoseconds | |
arrayReverseIterator(list) takes: 6918095 nanoseconds | |
list.reverseIterator takes: 9923154 nanoseconds | |
bufferReverseIterator(list).foreach takes:21668960 nanoseconds | |
arrayReverseIterator(list).foreach takes: 17371259 nanoseconds | |
list.reverseIterator.foreach takes: 28309173 nanoseconds | |
size of the list: 1 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 185681207 nanoseconds | |
arrayReverseIterator(list) takes: 35518261 nanoseconds | |
list.reverseIterator takes: 15715705 nanoseconds | |
bufferReverseIterator(list).foreach takes:178973978 nanoseconds | |
arrayReverseIterator(list).foreach takes: 36116974 nanoseconds | |
list.reverseIterator.foreach takes: 22499911 nanoseconds | |
size of the list: 3 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 198718591 nanoseconds | |
arrayReverseIterator(list) takes: 45548896 nanoseconds | |
list.reverseIterator takes: 33101612 nanoseconds | |
bufferReverseIterator(list).foreach takes:222342991 nanoseconds | |
arrayReverseIterator(list).foreach takes: 59946078 nanoseconds | |
list.reverseIterator.foreach takes: 66365120 nanoseconds | |
size of the list: 5 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 209070316 nanoseconds | |
arrayReverseIterator(list) takes: 52942951 nanoseconds | |
list.reverseIterator takes: 51928214 nanoseconds | |
bufferReverseIterator(list).foreach takes:267574454 nanoseconds | |
arrayReverseIterator(list).foreach takes: 91653758 nanoseconds | |
list.reverseIterator.foreach takes: 128539202 nanoseconds | |
size of the list: 8 | |
number of iterations: 1000000 | |
bufferReverseIterator(list) takes: 268580921 nanoseconds | |
arrayReverseIterator(list) takes: 66431573 nanoseconds | |
list.reverseIterator takes: 76675286 nanoseconds | |
bufferReverseIterator(list).foreach takes:318845518 nanoseconds | |
arrayReverseIterator(list).foreach takes: 126853150 nanoseconds | |
list.reverseIterator.foreach takes: 217233059 nanoseconds | |
size of the list: 10 | |
number of iterations: 100000 | |
bufferReverseIterator(list) takes: 28079353 nanoseconds | |
arrayReverseIterator(list) takes: 7218130 nanoseconds | |
list.reverseIterator takes: 8547880 nanoseconds | |
bufferReverseIterator(list).foreach takes:35528186 nanoseconds | |
arrayReverseIterator(list).foreach takes: 15033710 nanoseconds | |
list.reverseIterator.foreach takes: 26660954 nanoseconds | |
size of the list: 100 | |
number of iterations: 10000 | |
bufferReverseIterator(list) takes: 12133814 nanoseconds | |
arrayReverseIterator(list) takes: 6676375 nanoseconds | |
list.reverseIterator takes: 9398738 nanoseconds | |
bufferReverseIterator(list).foreach takes:21500335 nanoseconds | |
arrayReverseIterator(list).foreach takes: 12741820 nanoseconds | |
list.reverseIterator.foreach takes: 24319719 nanoseconds | |
size of the list: 1000 | |
number of iterations: 1000 | |
bufferReverseIterator(list) takes: 9439742 nanoseconds | |
arrayReverseIterator(list) takes: 5447427 nanoseconds | |
list.reverseIterator takes: 8607929 nanoseconds | |
bufferReverseIterator(list).foreach takes:20727398 nanoseconds | |
arrayReverseIterator(list).foreach takes: 15721768 nanoseconds | |
list.reverseIterator.foreach takes: 27707703 nanoseconds | |
size of the list: 10000 | |
number of iterations: 100 | |
bufferReverseIterator(list) takes: 10297294 nanoseconds | |
arrayReverseIterator(list) takes: 7934790 nanoseconds | |
list.reverseIterator takes: 10330618 nanoseconds | |
bufferReverseIterator(list).foreach takes:20465704 nanoseconds | |
arrayReverseIterator(list).foreach takes: 17399736 nanoseconds | |
list.reverseIterator.foreach takes: 27954786 nanoseconds | |
size of the list: 100000 | |
number of iterations: 10 | |
bufferReverseIterator(list) takes: 10062950 nanoseconds | |
arrayReverseIterator(list) takes: 6339012 nanoseconds | |
list.reverseIterator takes: 10698285 nanoseconds | |
bufferReverseIterator(list).foreach takes:23197279 nanoseconds | |
arrayReverseIterator(list).foreach takes: 19277151 nanoseconds | |
list.reverseIterator.foreach takes: 28336757 nanoseconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment