Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
8b9f12ef
Commit
8b9f12ef
authored
Oct 17, 2014
by
Sean Leather
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add perf tests for EncodedInputStream and AutoUTFInputStream
parent
98f87905
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
rapidjsontest.cpp
test/perftest/rapidjsontest.cpp
+22
-0
No files found.
test/perftest/rapidjsontest.cpp
View file @
8b9f12ef
...
...
@@ -28,6 +28,8 @@
#include "rapidjson/stringbuffer.h"
#include "rapidjson/filestream.h"
#include "rapidjson/filereadstream.h"
#include "rapidjson/encodedstream.h"
#include "rapidjson/memorystream.h"
#ifdef RAPIDJSON_SSE2
#define SIMD_SUFFIX(name) name##_SSE2
...
...
@@ -167,6 +169,26 @@ TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator)) {
}
}
TEST_F
(
RapidJson
,
SIMD_SUFFIX
(
DocumentParseEncodedInputStream_MemoryStream
))
{
for
(
size_t
i
=
0
;
i
<
kTrialCount
;
i
++
)
{
MemoryStream
ms
(
json_
,
length_
);
EncodedInputStream
<
UTF8
<>
,
MemoryStream
>
is
(
ms
);
Document
doc
;
doc
.
ParseStream
<
0
,
UTF8
<>
>
(
is
);
ASSERT_TRUE
(
doc
.
IsObject
());
}
}
TEST_F
(
RapidJson
,
SIMD_SUFFIX
(
DocumentParseAutoUTFInputStream_MemoryStream
))
{
for
(
size_t
i
=
0
;
i
<
kTrialCount
;
i
++
)
{
MemoryStream
ms
(
json_
,
length_
);
AutoUTFInputStream
<
unsigned
,
MemoryStream
>
is
(
ms
);
Document
doc
;
doc
.
ParseStream
<
0
,
AutoUTF
<
unsigned
>
>
(
is
);
ASSERT_TRUE
(
doc
.
IsObject
());
}
}
template
<
typename
T
>
size_t
Traverse
(
const
T
&
value
)
{
size_t
count
=
1
;
...
...
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