Nibbler: Improve import performance

Takes the "import" performance test from 5m5s on a test machine to 13s
total.

A huge part of the previously morbid performance were memory allocation
and release for very little benefit in the JSON parser.  With this new
approach the copying is kept to a minimum.  There is still room for
improvements.
This commit is contained in:
Wilhelm Schuermann
2015-09-15 18:14:18 +02:00
parent e478396a04
commit 605f8020b7
2 changed files with 162 additions and 161 deletions

View File

@@ -36,6 +36,7 @@
#include <string>
#include <vector>
#include <time.h>
#include <memory>
class Nibbler
{
@@ -110,7 +111,7 @@ public:
std::string dump ();
private:
std::string _input;
std::shared_ptr<std::string> _input;
std::string::size_type _length;
std::string::size_type _cursor;
std::string::size_type _saved;