Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericValue: improve copying performance #206

Merged
merged 1 commit into from
Nov 28, 2014

Conversation

pah
Copy link
Contributor

@pah pah commented Nov 26, 2014

The GenericValue "copy" constructor (with Allocator, see #20) 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.

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.
miloyip added a commit that referenced this pull request Nov 28, 2014
GenericValue: improve copying performance
@miloyip miloyip merged commit 7eee430 into Tencent:master Nov 28, 2014
@pah pah deleted the enhance/optimize-value-copy branch November 28, 2014 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants