Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-229

Use String.getBytes() to get an UTF-8 encoded byte array

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 4.4.2.Final
    • None
    • None
    • None
    • False
    • False
    • None
    • None

      Using String.getBytes(StandardCharsets.UTF_8)} seems to achieve better performance than {{StandardCharsets.UTF_8.encode(String).

      Also, replace ReentrantReadWriteLock with StampedLock.

      IPROTO-228

      Benchmark                                 Mode  Cnt     Score   Error  Units
      ProtostreamBenchmark.testMarshallAddress  avgt    6   265.675 ± 2.005  ns/op
      ProtostreamBenchmark.testMarshallUser     avgt    6  1257.325 ± 7.937  ns/op
      

      This JIRA:

      Benchmark                                        Mode  Cnt    Score   Error  Units
      ProtostreamBenchmark.testMarshallAddress         avgt    6  154.477 ± 0.431  ns/op
      ProtostreamBenchmark.testMarshallUser            avgt    6  648.798 ± 3.455  ns/op
      

            pruivo@redhat.com Pedro Ruivo
            pruivo@redhat.com Pedro Ruivo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: