miloyip/rapidjson — pull request #206 by pah (2014-11-26 22:12:57+00:00)
Title: GenericValue: improve copying performance

The `GenericValue` "copy" constructor (with Allocator) uses a temporary `GenericDocument` object to perform the deep copying with the provided allocator. This leads to the temporary allocation of the `Stack` memory, even in case of shallow values (numbers, etc.).

This patch improves the performance of this operation by only resorting the the SAX `Handler` implementation in case of Array or Object values.