title: The most efficient way o 3 Strings concatenation in java 8
body: <p>I have a multithreaded Http server in Java 8
  which gets thousands of requests per second and has to create responses which require <em>String concatenation</em>. What is the best (fastest) solution to this problem?</p>
  <p>I know that in general <code>StringBuilder</code> has much better performance than <code>+</code> operator and I thought StringBuilder will be the best solution but in this case I would have to initialize new StringBuilder for each request.</p>
  <p>Moreover, in my problem concatenation always require 3 strings - two of them are final and the middle one is a variable. The variable can take values from the set of <em>~20</em> different elements. So the number of possible concatenated strings equals <em>20 x number_of_different_strings</em> which is about <em>2000</em>.</p>
  <p>Is it better to use StringBuilder or just concatenate Strings (the number will not exceed 2k different strings) or maybe its better to store all created Strings (about 2k) in map and ask for specific one each time?</p>