perwendel/spark — pull request #180 by amarseillan (2014-08-05 15:26:01+00:00)
Title: Trie implementation for route matcher:

Made RouteMatcher an abstract class to accept different implementations
The RouteMatcherFactory can serve different implementations

Follow the conversation of [this other pull request](https://github.com/perwendel/spark/pull/149).
Tests all pass with the new implementation but I didn't think of a way of gracefully testing both of the implementations without replicating every single test.

Used [this benchmark](https://github.com/augustl/spark/commit/58da36453b33175018cb7d120470d5a3db1f823e) and added filters to it and more routes/loops resulting in a 40% better performance.

Results:

BEFORE:

RoutePerformanceTest.doBenchmark: [measured 10 out of 15 rounds, threads: 1 (sequential)]
round: 34.27 [+- 1.09], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 1502, GC.time: 3.01, time.total: 520.40, time.warmup: 177.70, time.bench: 342.70

AFTER:

RoutePerformanceTest.doBenchmark: [measured 10 out of 15 rounds, threads: 1 (sequential)]
round: 20.73 [+- 0.86], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 285, GC.time: 0.59, time.total: 313.37, time.warmup: 106.08, time.bench: 207.29