Hash Set and Array List performances

My experiment shows that HashSet is faster than an ArrayList starting at collections of 3 elements inclusively.

A complete results table

| Boost  |  Collection Size  |
|  2x    |       3 elements  |
|  3x    |      10 elements  |
|  6x    |      50 elements  |
|  12x   |     200 elements  |  <= proportion 532-12 vs 10.000-200 elements
|  532x  |  10.000 elements  |  <= shows linear lookup growth for the ArrayList

Leave a Comment