This repository was archived by the owner on Mar 24, 2026. It is now read-only.
=akka-http remove unnecessary copying of entity#2522
Merged
NateBrady23 merged 1 commit intoTechEmpower:masterfrom Jan 27, 2017
Merged
=akka-http remove unnecessary copying of entity#2522NateBrady23 merged 1 commit intoTechEmpower:masterfrom
NateBrady23 merged 1 commit intoTechEmpower:masterfrom
Conversation
Just a small improvement which I noticed while skimming the code. The HttpEntity call made on this line already makes the content type be `text/plain` (UTF-8), the additional call made here created an entire copy of the entity object for each request and did not really have to do that since it is the right content type already. See here: https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/scaladsl/model/HttpEntity.scala#L253 https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/scaladsl/model/HttpEntity.scala#L253
Contributor
|
Good catch! This looks good to me if Travis agrees! |
Contributor
Author
|
Thanks for merging! |
zloster
pushed a commit
to zloster/FrameworkBenchmarks
that referenced
this pull request
Mar 21, 2017
Just a small improvement which I noticed while skimming the code. The HttpEntity call made on this line already makes the content type be `text/plain` (UTF-8), the additional call made here created an entire copy of the entity object for each request and did not really have to do that since it is the right content type already. See here: https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/scaladsl/model/HttpEntity.scala#L253 https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/scaladsl/model/HttpEntity.scala#L253
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just a small improvement which I noticed while skimming the code.
The HttpEntity call made on this line already makes the content type be
text/plain(UTF-8), the additional call made here created an entire copy of the entity object for each request and did not really have to do that since it is the right content type already. See here: https://github.com/akka/akka-http/blob/master/akka-http-core/src/main/scala/akka/http/scaladsl/model/HttpEntity.scala#L253