=rem #16428 optimize protobuf serializer for master

#16428 for master
that looks almost correct, it can overwrite a method for the same class that is added concurrently, that is not a big deal, since any Method is good. A slightly modified variant that also protects against that could look something like:

    def fromBinary(bytes: Array[Byte], manifest: Option[Class[_]]): AnyRef =
      manifest match {
        case Some(clazz) ⇒
          val existingParsingMethodBinding = parsingMethodBindingRef.get()
          (existingParsingMethodBinding.get(clazz) match {
            case Some(m) => m
            case None =>
              @tailrec
              def cacheMethod(clazz: Class[_], method: Method, parsingMethodBinding: Map[Class[_], Method]): Method = {
                val newParsingMethodBinding = parsingMethodBinding.updated(clazz, method)
                if (parsingMethodBindingRef.compareAndSet(parsingMethodBinding, newParsingMethodBinding))
                  method
                else
                  cacheMethod(clazz, method, parsingMethodBindingRef.get())
              }
              val method = clazz.getDeclaredMethod("parseFrom", ARRAY_OF_BYTE_ARRAY: _*)
              cacheMethod(clazz, method, existingParsingMethodBinding)
          }).invoke(null, bytes).asInstanceOf[Message]
  
        case None ⇒ throw new IllegalArgumentException("Need a protobuf message class to be able to serialize bytes using protobuf")
      }