=rem #16428 optimize protobuf serializer for master

#16428 for master
I'm going to suggest a slightly modified version:

    @tailrec
    def parse(maybeCachedParsingMethod: Method): Message =
      if (maybeCachedParsingMethod ne null)
          maybeCachedParsingMethod.invoke(null, bytes).asInstanceOf[Message]
      else {      
          @tailrec addToCache(clazz: Class[_], method: Method): Method = {
            val parsingMethodBinding = parsingMethodBindingRef.get()
            parsingMethodBinding.get(clazz) match {
              case Some(cached) => cached
              case None =>
                val newParsingMethodBinding = parsingMethodBinding.updated(clazz, parsingMethod)
                if(parsingMethodBindingRef.compareAndSet(parsingMethodBinding, newParsingMethodBinding))
                  method
                else
                  addToCache(clazz, method)
            }
          }

        parse(addToCache(clazz, clazz.getDeclaredMethod("parseFrom", ProtobufSerializer.ARRAY_OF_BYTE_ARRAY: _*)))
      }

    parse(parsingMethodBindingRef.get().get(clazz).orNull)