Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks and improve performance of ServletIo#requestBody #171

Open
wants to merge 10 commits into
base: series/0.23
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ class ServletIoBenchmarks {
readListener.onAllDataRead()
result
}

override def read(buf: Array[Byte]) = {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 I should have realized that the default is one byte at a time via Read

val result = in.read(buf)
if (in.available() == 0)
readListener.onAllDataRead()
result
}

override def read(buf: Array[Byte], off: Int, len: Int) = {
val result = in.read(buf, off, len)
if (in.available() == 0)
readListener.onAllDataRead()
result
}
}

case class HttpServletRequestStub(
Expand Down