Is there a plan to add options to use std::string as the storage for string value? Since StaticString doesn't really save any allocation or duplication of string values, maybe switching to std::string will help? The modern C++ standard libraries implement std::string class with reference counting and copy-on-write, which reduces redundant allocation of duplicate strings.
I am going to try modifying the source to see if I can get it work. Will report back later.
Hello, I have the same problem. I found that jsoncpp is so slowly, It always take 10ms to write 60KB json string. I want to improve the performance. I use OProfile to find the problem, then I found that It take much time on the allocation of mermory.
I change the code of "Value::Value( const Value &other )" function like below. It runs quick a bit.
if ( other.allocated_ )
if ( other.value_.string_ )
value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ );
allocated_ = true;
value_.string_ = 0;
value_.string_ = other.value_.string_;
allocated_ = false;
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.