Skip to content

Commit

Permalink
Added a word about benchmarks and rename HttpServerBenchmark to HttpS…
Browse files Browse the repository at this point in the history
…erverHandlerBenchmark to be more accurate
  • Loading branch information
vietj committed Jun 26, 2017
1 parent 365ba40 commit e32d6b1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 47 additions & 0 deletions benchmarks.md
@@ -0,0 +1,47 @@
## Microbenchmarks

A few JMH benchmarks are available to measure performance of some Vert.x sensistive parts.

The benchmarks are executed with biased locking enabled.

The benchmarks configures a JMH executor that uses `VertxThread`.

Benchmarks are located in the `src/test/benchmarks` folder.

### How-to

Package the JMH microbenchmarks

```
> mvn package -DskipTests -Pbenchmarks
```

Run them all

```
> java -jar target/vertx-core-$VERSION-benchmarks.jar
```

### HttpHeaders benchmarks

- `HeadersEncodeBenchmark`: encode HttpHeaders
- `HeadersContainsBenchmarkv: HttpHeaders contains method
- `HeadersSetBenchmark`: HttpHeaders set method

```
> java -jar target/vertx-core-$VERSION-benchmarks.jar HeadersEncodeBenchmark
```

### HttpServer handler benchmarks

The `HttpServerHandlerBenchmark` benchmarks the `HttpServer` that deals with `HttpRequest` and `HttpResponse`
objects. It mainly compares a simple _hello world_ application written with Vert.x and Netty.

```
> java -jar target/vertx-core-$VERSION-benchmarks.jar HttpServerHandlerBenchmark
```

### Context benchmarks

The `RunOnContextBenchmark` measures the impact of the disabling thread checks, context timing that are done
when running Vert.x context tasks.
Expand Up @@ -63,7 +63,7 @@
*/
@State(Scope.Thread)
@Threads(16)
public class HttpServerBenchmark extends BenchmarkBase {
public class HttpServerHandlerBenchmark extends BenchmarkBase {

private static final ByteBuf GET = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer((
"GET / HTTP/1.1\r\n" +
Expand Down

0 comments on commit e32d6b1

Please sign in to comment.