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
74a13567
Commit
74a13567
authored
Jul 17, 2014
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add VC itoa perf comparison
parent
e1cdf122
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
misctest.cpp
test/perftest/misctest.cpp
+27
-1
No files found.
test/perftest/misctest.cpp
View file @
74a13567
...
@@ -422,7 +422,7 @@ private:
...
@@ -422,7 +422,7 @@ private:
};
};
template
<>
template
<>
inline
bool
Writer1
<
rapidjson
::
StringBuffer
>::
WriteUint
(
unsigned
u
)
{
bool
Writer1
<
rapidjson
::
StringBuffer
>::
WriteUint
(
unsigned
u
)
{
char
buffer
[
10
];
char
buffer
[
10
];
char
*
p
=
buffer
;
char
*
p
=
buffer
;
do
{
do
{
...
@@ -953,6 +953,32 @@ TEST_F(Misc, itoa64_sprintf) {
...
@@ -953,6 +953,32 @@ TEST_F(Misc, itoa64_sprintf) {
OUTPUT_LENGTH
(
length
);
OUTPUT_LENGTH
(
length
);
}
}
#ifdef _MSC_VER
TEST_F
(
Misc
,
itoa_VC
)
{
size_t
length
=
0
;
for
(
size_t
i
=
0
;
i
<
kItoaTrialCount
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
randvalCount
;
j
++
)
{
char
buffer
[
32
];
_itoa
(
randval
[
j
],
buffer
,
10
);
length
+=
strlen
(
buffer
);
}
}
OUTPUT_LENGTH
(
length
);
}
TEST_F
(
Misc
,
itoa64_VC
)
{
size_t
length
=
0
;
for
(
size_t
i
=
0
;
i
<
kItoaTrialCount
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
randvalCount
;
j
++
)
{
char
buffer
[
32
];
_i64toa
(
randval
[
j
]
*
randval
[
j
],
buffer
,
10
);
length
+=
strlen
(
buffer
);
}
}
OUTPUT_LENGTH
(
length
);
}
#endif
TEST_F
(
Misc
,
itoa_strtk
)
{
TEST_F
(
Misc
,
itoa_strtk
)
{
size_t
length
=
0
;
size_t
length
=
0
;
std
::
string
s
;
std
::
string
s
;
...
...
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