Skip to content

Instantly share code, notes, and snippets.

@aesteve
Created July 10, 2015 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aesteve/c770005031d568d4e037 to your computer and use it in GitHub Desktop.
Save aesteve/c770005031d568d4e037 to your computer and use it in GitHub Desktop.
Some example on what we could benchmark
// create an object
public class SomeObject {
public Date someDate;
public Integer someInt;
public String someString;
public Double someDouble;
}
// create vertx handler
router.put("/vertx", ctx -> {
JsonObject json = ctx.getBodyAsJson();
json.put("someInt", json.getInteger("someInt") + ctx.request().param("someInt"));
// etc : do some stuff with all the attributes AND ALSO request parameters
ctx.response().end(json);
});
// create the exact same (functionally speaking) handler with Nubes
@Controller("/nubes")
@ContentType("application/json")
public class BenchmarkController {
@PUT
public SomeObject changeTheObject(@RequestBody SomeObject original, @Param("someInt") Integer someInt, ...) {
original.someInt += someInt;
// etc. play with every attribute
return original;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment