Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
d1ac3d99
Commit
d1ac3d99
authored
Dec 11, 2013
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark
parent
5dbdba3c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
JSON_benchmark.cc
benchmark/JSON_benchmark.cc
+6
-3
benchmark.py
benchmark/benchmark.py
+11
-0
configure.ac
configure.ac
+1
-1
No files found.
benchmark/JSON_benchmark.cc
View file @
d1ac3d99
#include <iostream>
#include <iostream>
#include <fstream>
#include <fstream>
#include <ctime>
#include <JSON.h>
#include <JSON.h>
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
time_t
timer1
,
timer2
;
JSON
json
;
JSON
json
;
std
::
ifstream
infile
(
argv
[
1
]);
std
::
ifstream
infile
(
argv
[
1
]);
time
(
&
timer1
);
json
<<
infile
;
json
<<
infile
;
time
(
&
timer2
);
std
::
cout
<<
json
.
size
()
<<
"
\n
"
;
std
::
cout
<<
"Parsing from std::ifstream: "
<<
difftime
(
timer2
,
timer1
)
<<
" sec
\n
"
;
return
0
;
return
0
;
}
}
benchmark/benchmark.py
0 → 100755
View file @
d1ac3d99
#!/usr/bin/env python
import
json
import
sys
import
datetime
a
=
datetime
.
datetime
.
now
()
data
=
json
.
loads
(
open
(
sys
.
argv
[
1
])
.
read
())
b
=
datetime
.
datetime
.
now
()
print
(
b
-
a
)
configure.ac
View file @
d1ac3d99
AC_INIT([JSON], [1.0], [niels.lohmann@uni-rostock.de])
AC_INIT([JSON], [1.0], [niels.lohmann@uni-rostock.de])
AC_CONFIG_SRCDIR([src/JSON.cc])
AC_CONFIG_SRCDIR([src/JSON.cc])
AM_INIT_AUTOMAKE([foreign])
AM_INIT_AUTOMAKE([foreign
subdir-objects
])
AM_SILENT_RULES([yes])
AM_SILENT_RULES([yes])
AC_PROG_CXX
AC_PROG_CXX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment