Skip to content

Commit 7647cb2

Browse files
committed
Added dropbox
1 parent 1fcd268 commit 7647cb2

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "dependencies/sajson"]
55
path = dependencies/sajson
66
url = https://github.com/chadaustin/sajson.git
7+
[submodule "dependencies/json11"]
8+
path = dependencies/json11
9+
url = https://github.com/dropbox/json11.git

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
.PHONY: clean cleandist
88

9-
CXXFLAGS = -std=c++11 -march=native -Wall -Wextra -Wshadow -Iinclude -Ibenchmark/linux -Idependencies/rapidjson/include -Idependencies/sajson/include
9+
CXXFLAGS = -std=c++11 -march=native -Wall -Wextra -Wshadow -Iinclude -Ibenchmark/linux -Idependencies/rapidjson/include -Idependencies/sajson/include -Idependencies/json11
1010

1111
ifeq ($(SANITIZE),1)
1212
CXXFLAGS += -g3 -O0 -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
@@ -24,7 +24,7 @@ MINIFIERLIBFILES=src/jsonminifier.cpp
2424

2525
RAPIDJSON_INCLUDE:=dependencies/rapidjson/include
2626
SAJSON_INCLUDE:=dependencies/sajson/include
27-
27+
JSON11_INCLUDE:=dependencies/json11/json11.hpp
2828

2929
LIBS=$(RAPIDJSON_INCLUDE) $(SAJSON_INCLUDE)
3030

@@ -46,6 +46,9 @@ $(SAJSON_INCLUDE):
4646
$(RAPIDJSON_INCLUDE):
4747
git submodule update --init --recursive
4848

49+
$(JSON11_INCLUDE):
50+
git submodule update --init --recursive
51+
4952

5053
bench: benchmarks/bench.cpp $(RAPIDJSON_INCLUDE) $(HEADERS)
5154
$(CXX) -std=c++11 -O3 -o $@ benchmarks/bench.cpp -I$(RAPIDJSON_INCLUDE) -Iinclude -march=native -lm -Wall -Wextra -Wno-narrowing

benchmark/parsingcompetition.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "rapidjson/reader.h" // you have to check in the submodule
1010
#include "rapidjson/stringbuffer.h"
1111
#include "rapidjson/writer.h"
12-
12+
#include "json11.cpp"
1313
#include "sajson.h"
1414

1515

@@ -69,6 +69,8 @@ int main(int argc, char *argv[]) {
6969
size_t * ast_buffer = (size_t *) malloc(astbuffersize * sizeof(size_t));
7070

7171
BEST_TIME("sajson (static alloc)", sajson::parse(sajson::bounded_allocation(ast_buffer, astbuffersize), sajson::mutable_string_view(p.second, buffer)).is_valid(), true, memcpy(buffer, p.first, p.second), repeat, volume, true);
72+
std::string json11err;
73+
BEST_TIME("dropbox (json11) ", json11::Json::parse(buffer,json11err).is_null(), false, memcpy(buffer, p.first, p.second), repeat, volume, true);
7274

7375
free(buffer);
7476
free(p.first);

dependencies/json11

Submodule json11 added at ec4e452

0 commit comments

Comments
 (0)