lift/framework — pull request #1435 by wpalmeri (2013-04-17 00:19:16+00:00)
Title: Optimized JValue Serialization and Specs improvements

Our servers do lots of serialization of JValues. During profiling we noticed that the compact(prepare(json)) method was a big CPU bottleneck. This pull request adds a `compactRender` method that serializes a JValue directly to a String using a StringBuilder. In internal testing, this method is anywhere from 50-100% faster.

I added a new benchmark for comparison.

This PR also updates many of the Specs in the lift-json project. The Specs were incorrect in that many of the must clauses were being ignored as only the expectation returned by a Spec is evaluated by the SpecRunner (as opposed to `assert` type tests in JUnit). I have gone through the Specs and `and`'ed clauses together where appropriate.

I recommend an audit of the rest of the specs in the other lift packages.

Will Palmeri
Co-Founder
StackMob