From aafb252770471d97876c8cb733a1daab00a366f5 Mon Sep 17 00:00:00 2001 From: Mikhail Bezoyan Date: Mon, 30 Sep 2024 10:53:45 +0000 Subject: [PATCH] [finagle-memcached] Minor perf optimizations Removed unnecessary toSeq, also made FrameDecoder an abstract class to avoid more expensive interface calls. Differential Revision: https://phabricator.twitter.biz/D1173582 --- .../twitter/finagle/memcached/protocol/text/FrameDecoder.scala | 2 +- .../scala/com/twitter/finagle/memcached/util/ParserUtils.scala | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/FrameDecoder.scala b/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/FrameDecoder.scala index a93415b1a1..576b995d17 100644 --- a/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/FrameDecoder.scala +++ b/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/FrameDecoder.scala @@ -3,7 +3,7 @@ package com.twitter.finagle.memcached.protocol.text import com.twitter.io.Buf import scala.collection.mutable -private[memcached] trait FrameDecoder[Result] { +private[memcached] abstract class FrameDecoder[Result] { /** * Return the number of raw bytes needed, or -1 if a text line is needed. diff --git a/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util/ParserUtils.scala b/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util/ParserUtils.scala index b1aa43b043..cc6c2d89b9 100644 --- a/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util/ParserUtils.scala +++ b/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util/ParserUtils.scala @@ -44,7 +44,7 @@ object ParserUtils { segmentStart = segmentEnd + 1 } } - split.toSeq + split } /** @@ -69,5 +69,4 @@ object ParserUtils { num } } - }