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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user