title: Fastest way to get the names of the fields of a case class in Scala
body: <p>This is related to the following question: <a href="https://stackoverflow.com/questions/12797300/in-scala-how-to-turn-objects-values-into-mapstring-string">In scala, how to turn object&#39;s values into Map[String, String]?</a></p>
  
  <p>In fact, I have almost exactly the same problem. However, the solution given in the accepted answer runs around 50x slower than <code>productIterator</code> (which returns only the values of the fields) when iterating 1000 times on my machine (or manually writing a function to return the list of (key, value) pairs). Is there a reasonably performant and clean way of getting the names of the fields of a case class in Scala? It seems strange to me that the core language would provide a performant reflection-like way of getting the values, but not the field names.</p>