-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into uri-fixing
- Loading branch information
Showing
4 changed files
with
209 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# These settings are synced to GitHub by https://probot.github.io/apps/settings/ | ||
repository: | ||
homepage: "https://www.playframework.com/documentation/latest/JavaWS" | ||
topics: playframework, asynchttpclient, scala, http-client, java, asynchronous, reactive, reactive-streams | ||
private: false | ||
has_issues: true | ||
has_projects: true | ||
# We don't need wiki since the documentation lives in playframework.com | ||
has_wiki: false | ||
has_downloads: true | ||
default_branch: master | ||
allow_squash_merge: true | ||
allow_merge_commit: false | ||
allow_rebase_merge: false | ||
|
||
teams: | ||
- name: core | ||
permission: admin | ||
- name: integrators | ||
permission: write | ||
|
||
branches: | ||
- name: "*" | ||
protection: | ||
required_pull_request_reviews: | ||
required_approving_review_count: 1 | ||
dismiss_stale_reviews: true | ||
# Require status checks to pass before merging | ||
required_status_checks: | ||
# The list of status checks to require in order to merge into this branch | ||
contexts: ["Travis CI - Pull Request", "typesafe-cla-validator"] | ||
|
||
labels: | ||
- color: f9d0c4 | ||
name: "closed:declined" | ||
- color: f9d0c4 | ||
name: "closed:duplicated" | ||
oldname: duplicate | ||
- color: f9d0c4 | ||
name: "closed:invalid" | ||
oldname: invalid | ||
- color: f9d0c4 | ||
name: "closed:question" | ||
oldname: question | ||
- color: f9d0c4 | ||
name: "closed:wontfix" | ||
oldname: wontfix | ||
- color: 7057ff | ||
name: "good first issue" | ||
- color: 7057ff | ||
name: "Hacktoberfest" | ||
- color: 7057ff | ||
name: "help wanted" | ||
- color: cceecc | ||
name: "status:backlog" | ||
oldname: backlog | ||
- color: b60205 | ||
name: "status:block-merge" | ||
oldname: block-merge | ||
- color: b60205 | ||
name: "status:blocked" | ||
- color: 0e8a16 | ||
name: "status:in-progress" | ||
- color: 0e8a16 | ||
name: "status:merge-when-green" | ||
oldname: merge-when-green | ||
- color: fbca04 | ||
name: "status:needs-backport" | ||
oldname: needs-backport | ||
- color: fbca04 | ||
name: "status:needs-forwardport" | ||
- color: fbca04 | ||
name: "status:needs-info" | ||
- color: fbca04 | ||
name: "status:needs-verification" | ||
oldname: needs-confirmation | ||
- color: 0e8a16 | ||
name: "status:ready" | ||
- color: fbca04 | ||
name: "status:to-review" | ||
oldname: review | ||
- color: c5def5 | ||
name: "topic:build/tests" | ||
- color: c5def5 | ||
name: "topic:dev-environment" | ||
- color: c5def5 | ||
name: "topic:documentation" | ||
- color: c5def5 | ||
name: "topic:jdk-next" | ||
- color: b60205 | ||
name: "type:defect" | ||
oldname: bug | ||
- color: 0052cc | ||
name: "type:feature" | ||
- color: 0052cc | ||
name: "type:improvement" | ||
oldname: enhancement | ||
- color: 0052cc | ||
name: "type:updates" | ||
- color: 0052cc | ||
name: "type:upstream" | ||
oldname: akka-http-backend |
77 changes: 77 additions & 0 deletions
77
bench/src/main/scala/play/api/libs/ws/ahc/StandaloneAhcWSRequestBenchMapsBench.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package play.api.libs.ws.ahc | ||
|
||
import java.util.concurrent.TimeUnit | ||
|
||
import akka.stream.Materializer | ||
import org.openjdk.jmh.annotations._ | ||
import org.openjdk.jmh.infra.Blackhole | ||
import play.api.libs.ws.StandaloneWSRequest | ||
|
||
/** | ||
* Tests Map-backed features of [[StandaloneAhcWSRequest]]. | ||
* | ||
* ==Quick Run from sbt== | ||
* | ||
* > bench/jmh:run .*StandaloneAhcWSRequestBenchMapsBench | ||
* | ||
* ==Using Oracle Flight Recorder== | ||
* | ||
* To record a Flight Recorder file from a JMH run, run it using the jmh.extras.JFR profiler: | ||
* > bench/jmh:run -prof jmh.extras.JFR .*StandaloneAhcWSRequestBenchMapsBench | ||
* | ||
* Compare your results before/after on your machine. Don't trust the ones in scaladoc. | ||
* | ||
* Sample benchmark results: | ||
* {{{ | ||
* > bench/jmh:run .*StandaloneAhcWSRequestBenchMapsBench | ||
* [info] Benchmark (size) Mode Cnt Score Error Units | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addHeaders 1 avgt 162.673 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addHeaders 10 avgt 195.672 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addHeaders 100 avgt 278.829 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addHeaders 1000 avgt 356.446 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addHeaders 10000 avgt 308.384 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addQueryParams 1 avgt 42.123 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addQueryParams 10 avgt 82.650 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addQueryParams 100 avgt 90.095 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addQueryParams 1000 avgt 123.221 ns/op | ||
* [info] StandaloneAhcWSRequestBenchMapsBench.addQueryParams 10000 avgt 141.556 ns/op | ||
* }}} | ||
* | ||
* @see https://github.com/ktoso/sbt-jmh | ||
*/ | ||
@OutputTimeUnit(TimeUnit.NANOSECONDS) | ||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
@Fork(jvmArgsAppend = Array("-Xmx350m", "-XX:+HeapDumpOnOutOfMemoryError"), value = 1) | ||
@State(Scope.Benchmark) | ||
class StandaloneAhcWSRequestBenchMapsBench { | ||
|
||
private implicit val materializer: Materializer = null // we're not actually going to execute anything. | ||
private var exampleRequest: StandaloneWSRequest = _ | ||
|
||
@Param(Array("1", "10", "100", "1000", "10000")) | ||
private var size: Int = _ | ||
|
||
@Setup def setup(): Unit = { | ||
val params = (1 to size) | ||
.map(_.toString) | ||
.map(s => s -> s) | ||
|
||
exampleRequest = StandaloneAhcWSRequest(new StandaloneAhcWSClient(null), "https://www.example.com") | ||
.addQueryStringParameters(params: _*) | ||
.addHttpHeaders(params: _*) | ||
} | ||
|
||
@Benchmark | ||
def addQueryParams(bh: Blackhole): Unit = { | ||
bh.consume(exampleRequest.addQueryStringParameters("nthParam" -> "nthParam")) | ||
} | ||
|
||
@Benchmark | ||
def addHeaders(bh: Blackhole): Unit = { | ||
bh.consume(exampleRequest.addHttpHeaders("nthHeader" -> "nthHeader")) | ||
} | ||
} |
This file contains 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
This file contains 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