title: Fastest data structure for access/modification in Java
body: <p>Hi there Stackoverflowers!</p>
  
  <p>I was coding a project when I wondered which is the fastest data structure that allows me the best performance if I have to access/edit a lot that data?</p>
  
  <p>Let me explain with an example.
  I have a class called User and a class Event. A User can have many events. Until now, I have implemented this situation with an ArrayList:</p>
  
  <pre><code>public class User{
      ArrayList&lt;Event&gt; events;
      public void process(){
      }
      ...
  }
  public class Event{
      event data like event time etc.
  }
  </code></pre>
  
  <p>Since I have a lot of users(millions), every user can have potentially thousands of events, and, moreover, I have to access every event of a user with process() method, I think that using structures like HashMaps etc. would not be helpful(If am wrong please tell me).
  However, it is obvious that with this number of elements, good performance is a need.</p>
  
  <p>So, what do you think the fastest data structure to handle the events is?</p>
  
  <p>Thank you very much,</p>
  
  <p>Marco.</p>