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

WS: Optimize first empty frame #748

Closed
jrudolph opened this issue Jan 10, 2017 · 1 comment
Closed

WS: Optimize first empty frame #748

jrudolph opened this issue Jan 10, 2017 · 1 comment
Assignees
Labels
t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module t:server Issues related to the HTTP server
Milestone

Comments

@jrudolph
Copy link
Member

For implementation reasons, the WS implementation sends out a streamed WS message as this succession of frames:

TEXT         fin = false empty
CONTINUATION fin = false data chunk 1 
CONTINUATION fin = false data chunk 2
...
CONTINUATION fin = true  empty

def streamedFrames[M](opcode: Opcode, data: Source[ByteString, M]): Source[FrameStart, NotUsed] =
:

      Source.single(FrameEvent.empty(opcode, fin = false)) ++
        data.map(FrameEvent.fullFrame(Opcode.Continuation, None, _, fin = false)) ++
        Source.single(FrameEvent.emptyLastContinuationFrame)

The first frame could be optimized away.

This was observed in #730 by @elseorand.

@jrudolph jrudolph added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module t:server Issues related to the HTTP server labels Jan 10, 2017
jrudolph added a commit to jrudolph/akka-http that referenced this issue Jan 10, 2017
Previously, a single empty frame was created to start a WS message. Now,
a streamed message will only be begun when the first data comes in.
jrudolph added a commit to jrudolph/akka-http that referenced this issue Jan 10, 2017
Previously, a single empty frame was created to start a WS message. Now,
a streamed message will only be begun when the first data comes in.
jrudolph added a commit to jrudolph/akka-http that referenced this issue Jan 16, 2017
Previously, a single empty frame was created to start a WS message. Now,
a streamed message will only be begun when the first data comes in.
jrudolph added a commit that referenced this issue Jan 16, 2017
…ession

=htc #748 optimize frame creation for streamed WS messages
@jrudolph jrudolph added this to the 10.0.2 milestone Jan 16, 2017
@jrudolph
Copy link
Member Author

Fixed by #749.

@ktoso ktoso closed this as completed Jan 26, 2017
@ktoso ktoso removed the 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted label Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module t:server Issues related to the HTTP server
Projects
None yet
Development

No branches or pull requests

2 participants