Skip to content

dump() performance degradation in v2 #272

@duncanwerner

Description

@duncanwerner

(This should maybe go into #202?)

Testing a switch from v1.1 -> v2.0 I found fairly significant performance degradation in dump() with a large set of doubles. Here's a sample implementation:

json data;
std::vector< double > vec(5e5);
srand(1);
for( int i = 0; i< 5e5; i++ ){ vec[i] = rand();}
data = vec;
std::string str = data.dump();

compiled with vs2015 on windows. Using v1.1 the dump call takes ~550ms. With 2.0 it takes ~25000ms (50x). I haven't tested on any other platforms (although I can do that if it's helpful).

Granted this is an edge case, but it's a pretty dramatic change.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions