Avoid boxing in Framing (#1247)

* Fix FramingBenchmark

* Add specialized indexOfByte

* Rename indexOfByte to indexOf

* Add missing @since(1.1.0) and reformat scaladoc

* Fix Scala 2.12 ambiguity problem

* Inline nextString

* Change default ByteString#indexOf to call indexWhere

This is always overriden, but I guess it won't hurt to have a default

* Remove default indexOf override

Calling indexWhere is already the default

* Fix MiMa issues
This commit is contained in:
João Costa 2024-05-06 20:19:40 +01:00 committed by GitHub
parent b6f2c5774e
commit cce5f9b0d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 318 additions and 11 deletions

View file

@ -80,7 +80,7 @@ class FramingBenchmark {
val frame = List.range(0, messageSize, 1).map(_ => Random.nextPrintableChar()).mkString + "\n"
val messageChunk = ByteString(List.range(0, framePerSeq, 1).map(_ => frame).mkString)
Source
flow = Source
.fromGraph(new BenchTestSourceSameElement(100000, messageChunk))
.via(Framing.delimiter(ByteString("\n"), Int.MaxValue))
}