akamensky/XpressJ — pull request #1 by augustl (2014-08-10 23:21:58+00:00)
Title: Using path-travel-agent for routing

Filing a pull request for integrating path-travel-agent into XpressJ for performing the route matching, as discussed here: https://github.com/augustl/path-travel-agent/issues/3

A small tweak had to be done in 1eb2ec9, some of the code expected the XpressJ impl of an interface, instead of any implementation of the interface.

The benchmark was also refactored to not go through Jetty. This tweak made the benchmark run the old XpressJ integrated route matcher benchmark in 3-4 seconds instead of 25-30 seconds :) The benchmark was also extended to run both the old built-in code and new path-travel-agent code, for easy comparison. Here are the benchmark numbers it reports on my machine:

```
PerformanceBenchmarkTest.doPtaBenchmark: [measured 10 out of 15 rounds, threads: 1 (sequential)]
round: 0.06 [+- 0.01], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 5, GC.time: 0.00, time.total: 1.15, time.warmup: 0.59, time.bench: 0.56
PerformanceBenchmarkTest.doRouteMatcherBenchmark: [measured 10 out of 15 rounds, threads: 1 (sequential)]
round: 0.30 [+- 0.05], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 40, GC.time: 0.04, time.total: 4.50, time.warmup: 1.47, time.bench: 3.03
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.468 sec
```

In other words, the new code does in 0.56 seconds what the old code does in 3 seconds, with 1/8 as many GC calls.

Note that path-travel-agent still hasn't been pushed to maven central, so to run the tests, you need to obtain path-travel-agent and `mvn install` it.