lift/framework — pull request #1500 by chriswebster (2013-11-03 15:40:13+00:00)
Title: Improve performance of decomposing case classes to Json

The Extraction.decompose method used Class.getDeclaredField which performs a linear scan of the fields for each element in the case class constructor. This pull request does a single pass over the fields storing them in a map hence reducing the algorithm complexity to O(n).

A benchmark (https://gist.github.com/chriswebster/7291295) before and after the change showed:

Before change:
[info] Running ExtractionBenchmark 3 100000
ExtractionBenchmark$	2675	2390 2418

After change:
info] Running ExtractionBenchmark 3 100000
ExtractionBenchmark$	1131	843	817