title: Meaning of registering a class with kryo serialization
body: <p>I don't understand what does it mean to register a class for kryo serialization.
  To give some background the <a href="https://spark.apache.org/docs/latest/tuning.htmlhttp://" rel="nofollow noreferrer">link</a> here says that </p>
  
  <blockquote>
    <p>Kryo does not support all Serializable types and requires you to register the classes you’ll use in the program in advance for best performance.</p>
  </blockquote>
  
  <p>Again, I don't understand what is the meaning of registering a class? Isn't the serialization code static in the sense that you apply the same logic to serialize all kinds of objects. How could mentioning in advanced the classes that will be serialized be helpful later then?</p>
  
  <p>Thanks!</p>