Sequences
caution
These benchmarks should not be used as a definitive answer to which collections are best. It's typical for different implementations to perform better for specific use cases. You are strongly encouraged to verify any results.
Also bear in mind that these numbers are in microseconds.
N = 10 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 1.16 | 0.21 | 3.19 | 0.71 | 1.77 | 3.28 | 1.37 | 0.21 | 2.75 | 3.69 | 1.60 | 3.35 | 2.66 | 1.85 | 1.18 |
Dart List | 0.31 | 0.18 | 3.38 | 0.55 | 1.14 | 3.11 | 0.90 | 0.20 | 3.13 | 0.32 | 2.73 | 1.69 | 1.15 | 0.23 | |
Dartz IList | 3.07 | 2.79 | 0.68 | 1.80 | 0.79 | 1.66 | 0.15 | 1.22 | 0.31 | ||||||
FIC IList | 0.31 | 0.27 | 0.87 | 0.81 | 2.58 | 3.55 | 1.42 | 0.22 | 3.94 | 3.45 | 1.25 | 5.57 | 3.75 | 2.67 | 0.78 |
Kt List | 1.98 | 0.23 | 3.22 | 0.73 | 2.49 | 2.79 | 1.38 | 0.22 | 4.46 | 3.28 | 1.54 | 3.11 | 3.38 | ||
Ribs IChain | 0.55 | 1.50 | 0.47 | 10.25 | 1.85 | 0.36 | 8.75 | 2.10 | 0.60 | 1.33 | 3.16 | ||||
Ribs IList | 3.40 | 0.30 | 1.65 | 0.42 | 0.19 | 1.83 | 1.02 | 0.16 | 4.80 | 1.84 | 0.15 | 1.18 | 0.05 | 0.76 | 1.78 |
Ribs IVector | 4.25 | 0.25 | 16.65 | 1.70 | 1.77 | 5.89 | 2.32 | 0.68 | 2.20 | 2.19 | 4.18 | 9.70 | 2.18 | 1.67 | 4.27 |
N = 100 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 3.59 | 0.19 | 18.43 | 4.81 | 10.46 | 18.79 | 9.63 | 0.20 | 19.90 | 23.73 | 8.11 | 22.51 | 19.78 | 10.59 | 3.59 |
Dart List | 0.34 | 0.17 | 22.46 | 3.51 | 7.98 | 23.31 | 7.02 | 0.19 | 21.78 | 0.32 | 20.25 | 15.23 | 8.04 | 0.21 | |
Dartz IList | 20.41 | 20.16 | 4.07 | 13.19 | 4.57 | 13.62 | 0.14 | 9.15 | 0.29 | ||||||
FIC IList | 0.30 | 0.26 | 0.85 | 4.95 | 15.99 | 20.20 | 9.54 | 0.21 | 31.89 | 25.21 | 7.78 | 44.40 | 30.62 | 16.75 | 3.94 |
Kt List | 7.91 | 0.22 | 17.59 | 4.90 | 14.48 | 17.23 | 9.30 | 0.21 | 24.53 | 20.13 | 10.00 | 18.93 | 13.47 | ||
Ribs IChain | 0.54 | 7.44 | 0.46 | 85.60 | 11.91 | 0.35 | 52.51 | 14.67 | 0.59 | 9.07 | 5.09 | ||||
Ribs IList | 22.82 | 1.20 | 12.40 | 2.17 | 1.08 | 17.15 | 7.04 | 0.14 | 41.35 | 14.60 | 0.14 | 8.79 | 0.05 | 6.55 | 12.86 |
Ribs IVector | 2.62 | 0.29 | 50.06 | 9.01 | 9.89 | 28.86 | 15.36 | 0.66 | 1.19 | 17.10 | 2.41 | 51.07 | 5.90 | 9.20 | 33.17 |
N = 1000 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 29.25 | 0.19 | 172.27 | 43.96 | 94.59 | 168.68 | 94.00 | 0.20 | 189.56 | 229.45 | 72.94 | 217.28 | 188.60 | 95.15 | 29.17 |
Dart List | 0.33 | 0.18 | 211.25 | 33.87 | 76.44 | 212.41 | 67.73 | 0.19 | 208.72 | 0.33 | 201.61 | 152.15 | 75.34 | 0.21 | |
Dartz IList | 202.24 | 196.30 | 37.50 | 127.74 | 44.63 | 136.28 | 0.14 | 88.66 | 0.29 | ||||||
FIC IList | 0.31 | 0.26 | 0.85 | 44.35 | 148.98 | 169.82 | 93.85 | 0.20 | 317.72 | 244.59 | 72.49 | 440.67 | 304.35 | 156.64 | 35.32 |
Kt List | 68.08 | 0.21 | 161.93 | 44.01 | 124.43 | 149.41 | 92.12 | 0.22 | 219.91 | 173.14 | 95.24 | 164.45 | 110.22 | ||
Ribs IChain | 0.54 | 64.41 | 0.46 | 856.06 | 111.01 | 0.35 | 502.56 | 142.32 | 0.58 | 87.08 | 24.81 | ||||
Ribs IList | 215.09 | 10.10 | 122.50 | 18.37 | 10.01 | 169.43 | 68.19 | 0.14 | 409.14 | 141.45 | 0.14 | 86.81 | 0.05 | 61.81 | 123.63 |
Ribs IVector | 3.73 | 0.28 | 425.83 | 78.92 | 16.41 | 214.32 | 146.48 | 0.65 | 1.83 | 166.29 | 0.68 | 482.82 | 5.94 | 18.93 | 325.78 |
N = 10000 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 293.22 | 0.19 | 1797.04 | 446.63 | 954.14 | 1811.45 | 935.33 | 0.20 | 1908.32 | 2285.10 | 744.01 | 2177.07 | 1908.88 | 958.90 | 314.82 |
Dart List | 0.43 | 0.18 | 2141.88 | 341.28 | 795.56 | 2238.20 | 676.86 | 0.19 | 2125.69 | 0.46 | 2053.59 | 1569.33 | 794.72 | 0.22 | |
Dartz IList | 2105.27 | 2124.27 | 371.41 | 1319.49 | 441.79 | 1437.66 | 0.14 | 960.25 | 0.30 | ||||||
FIC IList | 0.31 | 0.26 | 0.85 | 448.15 | 1538.07 | 1815.01 | 940.83 | 0.21 | 3172.88 | 2474.19 | 743.87 | 4389.39 | 3041.05 | 1597.63 | 384.67 |
Kt List | 740.03 | 0.22 | 4980.98 | 441.50 | 1384.73 | 1584.48 | 916.33 | 0.21 | 2490.20 | 2022.63 | 970.66 | 1931.55 | 1237.95 | ||
Ribs IChain | 0.54 | 641.32 | 0.47 | 10068.77 | 1134.11 | 0.35 | 5128.42 | 1466.00 | 0.59 | 917.89 | 231.76 | ||||
Ribs IList | 2208.08 | 115.39 | 1345.26 | 183.43 | 107.23 | 1700.58 | 672.67 | 0.14 | 4129.57 | 1453.93 | 0.14 | 914.21 | 0.05 | 641.63 | 1247.02 |
Ribs IVector | 6.22 | 0.32 | 3886.38 | 784.07 | 19.64 | 2030.55 | 1418.59 | 0.68 | 3.38 | 1691.53 | 15.31 | 5035.98 | 6.07 | 27.41 | 3120.23 |
N = 100000 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 10323.87 | 0.21 | 37574.93 | 4436.86 | 13335.51 | 31130.51 | 9188.61 | 0.21 | 25285.61 | 29103.77 | 14048.24 | 29008.08 | 26319.35 | 12844.73 | 9943.35 |
Dart List | 0.27 | 0.19 | 33792.16 | 3408.82 | 10886.07 | 30903.25 | 6676.20 | 0.20 | 27647.47 | 0.26 | 26720.30 | 21449.35 | 10698.90 | 0.22 | |
Dartz IList | 22678.04 | 22785.21 | 3557.65 | 14562.20 | 4389.13 | 14098.15 | 0.14 | 11015.47 | 0.29 | ||||||
FIC IList | 0.30 | 0.28 | 0.83 | 4400.97 | 18456.31 | 24806.07 | 9190.33 | 0.22 | 38058.56 | 30537.91 | 14564.64 | 51584.00 | 36465.88 | 19254.52 | 10969.70 |
Kt List | 16236.16 | 0.23 | 45322.13 | 4418.50 | 21354.80 | 22955.83 | 9018.97 | 0.22 | 46985.84 | 34336.85 | 16651.43 | 33590.25 | 22448.14 | ||
Ribs IChain | 0.53 | 6275.84 | 0.46 | 134994.67 | 11095.58 | 0.37 | 54378.30 | 15504.88 | 0.58 | 11877.36 | 2369.41 | ||||
Ribs IList | 23522.09 | 1151.77 | 13273.68 | 1851.51 | 1155.80 | 17185.47 | 6829.99 | 0.16 | 42646.67 | 15268.74 | 0.14 | 9953.59 | 0.05 | 6854.12 | 13039.68 |
Ribs IVector | 8.28 | 0.39 | 34656.00 | 7669.10 | 27.85 | 19960.82 | 13971.83 | 0.76 | 6.11 | 16821.51 | 24.64 | 53843.87 | 6.09 | 37.22 | 33898.37 |
N = 1000000 | append | apply | concat | contains | drop | filter | fold | head | init | map | prepend | reverse | tail | take | update |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Built List | 98913.91 | 0.20 | 381984.17 | 43974.02 | 130153.29 | 302685.88 | 91561.96 | 0.20 | 242738.78 | 286208.29 | 139024.75 | 277361.75 | 246613.33 | 122232.65 | 101096.00 |
Dart List | 0.28 | 0.18 | 356502.86 | 33270.97 | 111860.63 | 275909.75 | 66162.00 | 0.19 | 268994.63 | 0.46 | 277517.88 | 219748.00 | 110419.55 | 0.23 | |
Dartz IList | 994381.50 | 1313133.00 | 34382.45 | 194700.50 | 48492.72 | 575627.80 | 0.14 | 135687.00 | 0.29 | ||||||
FIC IList | 0.30 | 0.26 | 0.83 | 43885.65 | 177966.50 | 236876.56 | 91273.22 | 0.21 | 380880.00 | 302381.43 | 136366.75 | 510690.50 | 366809.67 | 199899.73 | 105332.81 |
Kt List | 140332.56 | 0.22 | 376197.00 | 43890.48 | 199338.73 | 211871.00 | 89098.65 | 0.21 | 431620.17 | 329998.33 | 166248.08 | 314403.13 | 219291.55 | ||
Ribs IChain | 0.53 | 64674.50 | 0.46 | 2091181.00 | 117565.17 | 0.35 | 912352.00 | 568463.40 | 0.59 | 114288.11 | 33479.92 | ||||
Ribs IList | 691927.33 | 15180.51 | 681674.80 | 21542.30 | 15376.38 | 174234.17 | 81651.72 | 0.15 | 962366.50 | 632679.00 | 0.14 | 105738.37 | 0.05 | 83413.08 | 180627.90 |
Ribs IVector | 7.40 | 0.36 | 368474.00 | 76166.70 | 48.59 | 201857.40 | 135372.07 | 0.71 | 6.03 | 172600.25 | 32.75 | 566647.50 | 6.09 | 31.50 | 351659.17 |