This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new e5698257bf ByteString performance (#3427)
e5698257bf is described below
commit e5698257bf4773f0acdca5f30197e0cf693d120d
Author: PJ Fanning <[email protected]>
AuthorDate: Wed Aug 12 19:56:31 2026 +0100
ByteString performance (#3427)
---
actor/src/main/scala/org/apache/pekko/util/ByteString.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
b/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
index 16b02a49c2..39035af217 100644
--- a/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/ByteString.scala
@@ -1455,7 +1455,7 @@ object ByteString {
/** Avoid `iterator` in performance sensitive code, call ops directly on
ByteString instead */
override def iterator: ByteIterator.MultiByteArrayIterator =
- ByteIterator.MultiByteArrayIterator(bytestrings.to(LazyList).map {
_.iterator })
+
ByteIterator.MultiByteArrayIterator(bytestrings.iterator.map(_.iterator).toList)
def ++(that: ByteString): ByteString = {
if (that.isEmpty) this
@@ -1802,7 +1802,7 @@ object ByteString {
bytestrings.foreach { bs =>
var i = 0
while (i < bs.length) {
- result(pos) = f(bs(i))
+ result(pos) = f(bs.byteAtUnchecked(i))
pos += 1
i += 1
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]