title: What is a fast alternative to HashMap for mapping to primitive types?
body: <p>First of all let me tell you that i have read the following questions that has been asked before <a href="https://stackoverflow.com/questions/1757363/java-hashmap-performance-optimization-alternative">Java HashMap performance optimization / alternative</a> and i have a similar question. </p>
  
  <p>What i want to do is take a LOT of dependencies from New york times text that will be processed by stanford parser to give dependencies and store the dependencies in a hashmap along with their scores, i.e. if i see a dependency twice i will increment the score from the hashmap by 1. </p>
  
  <p>The task starts off really quickly, about 10 sentences a second but scales off quickly. At 30 000 sentences( which is assuming 10 words in each sentence and about 3-4 dependences for each word which im storing) is about 300 000 entries in my hashmap. </p>
  
  <p>How will i be able to increase the performance of my hashmap? What kind of hashkey can i use?</p>
  
  <p>Thanks a lot 
  Martinos</p>
  
  <p>EDIT 1: </p>
  
  <p>ok guys maybe i phrased my question wrongly ok , well the byte arrays are not used in MY project but in the similar question of another person above. I dont know what they are using it for hence thats why i asked. </p>
  
  <p>secondly: i will not post code as i consider it will make things very hard to understand but here is a sample: </p>
  
  <p>With sentence : "i am going to bed" i have dependencies:
  (i , am , -1) 
  (i, going, -2)
  (i,to,-3) 
  (am, going, -1) 
  . 
  . 
  .
  (to,bed,-1) 
  These dependencies of all sentences(1 000 000 sentences) will be stored in a hashmap. 
  If i see a dependency twice i will get the score of the existing dependency and add 1. </p>
  
  <p>And that is pretty much it. All is well but the rate of adding sentences in hashmap(or retrieving) scales down on this line:
  dependancyBank.put(newDependancy, dependancyBank.get(newDependancy) + 1);
  Can anyone tell me why?
  Regards 
  Martinos</p>