File tree 3 files changed +44
-0
lines changed
3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ if $(JSON_SPIRIT_ROOT)
24
24
25
25
local RAPIDJSON_ROOT = [ os.environ RAPIDJSON_ROOT ] ;
26
26
27
+ local QT_ROOT = [ os.environ QTDIR ] ;
28
+ if $(QT_ROOT)
29
+ {
30
+ using qt5 : $(QT_ROOT) ;
31
+ }
32
+
27
33
# Declare targets for dependencies
28
34
lib jsoncpplib : : <name>jsoncpp : : <include>/usr/include/jsoncpp ;
29
35
@@ -52,6 +58,11 @@ bexe benchmark_spirit.cpp /json_spirit//json ;
52
58
bexe benchmark_rapidjson.cpp : <include>$(RAPIDJSON_ROOT)/include ;
53
59
bexe benchmark_jsoncpp.cpp jsoncpplib ;
54
60
61
+ if $(QT_ROOT)
62
+ {
63
+ exe benchmark_qjsondoc : benchmark_qjsondoc.cpp /qt5//QtCore ;
64
+ }
65
+
55
66
# TODO: find out how to run all programs after build
56
67
#actions run-benchmark { $(>[1]) ; }
57
68
#notfile benchmark_rapidjson-run : @run-benchmark : benchmark_rapidjson ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ List of currently measured libraries:
10
10
* [ jsoncpp] ( http://jsoncpp.sourceforge.net/ )
11
11
* [ libjson] ( http://sourceforge.net/projects/libjson/ )
12
12
* [ rapidjson] ( http://code.google.com/p/rapidjson/ )
13
+ * [ QJsonDocument] ( http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html )
13
14
14
15
Disclaimer
15
16
----------
Original file line number Diff line number Diff line change
1
+ //
2
+ // Copyright (C) 2013 Jeff Trull <[email protected] >
3
+ //
4
+ // Distributed under the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE_1_0.txt or copy at
6
+ // http://www.boost.org/LICENSE_1_0.txt)
7
+ //
8
+
9
+
10
+ #include " json_benchmark.hpp"
11
+
12
+ #include < QJsonDocument>
13
+
14
+
15
+ int main () {
16
+ try
17
+ {
18
+ jsonbench::run_benchmark (" QJsonDocument" , [](std::string const & s) {
19
+ QJsonParseError err;
20
+ return !QJsonDocument::fromJson (s.c_str (), &err).isNull () && (err.error == QJsonParseError::NoError);
21
+ });
22
+
23
+ return EXIT_SUCCESS;
24
+ }
25
+ catch (std::exception const & e)
26
+ {
27
+ std::cerr << e.what () <<std::endl;
28
+ }
29
+ return EXIT_FAILURE;
30
+
31
+ }
32
+
You can’t perform that action at this time.
0 commit comments