Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
8345467b
Commit
8345467b
authored
Sep 25, 2010
by
Pieter Noordhuis
Browse files
Free the replies after the tests are done
parent
9e417047
Changes
1
Hide whitespace changes
Inline
Side-by-side
test.c
View file @
8345467b
...
...
@@ -149,16 +149,20 @@ int main(void) {
for
(
i
=
0
;
i
<
500
;
i
++
)
freeReplyObject
(
redisCommand
(
c
,
"LPUSH mylist foo"
));
replies
=
malloc
(
sizeof
(
redisReply
*
)
*
1000
);
t1
=
usec
();
for
(
i
=
0
;
i
<
1000
;
i
++
)
freeReplyObject
(
redisCommand
(
c
,
"PING"
));
for
(
i
=
0
;
i
<
1000
;
i
++
)
replies
[
i
]
=
redisCommand
(
c
,
"PING"
);
t2
=
usec
();
for
(
i
=
0
;
i
<
1000
;
i
++
)
freeReplyObject
(
replies
[
i
]);
free
(
replies
);
printf
(
"
\t
(1000x PING: %.2fs)
\n
"
,
(
t2
-
t1
)
/
1000000
.
0
);
replies
=
malloc
(
sizeof
(
redisReply
*
)
*
1000
);
t1
=
usec
();
for
(
i
=
0
;
i
<
1000
;
i
++
)
freeReplyObject
(
redisCommand
(
c
,
"LRANGE mylist 0 499"
));
for
(
i
=
0
;
i
<
1000
;
i
++
)
replies
[
i
]
=
redisCommand
(
c
,
"LRANGE mylist 0 499"
);
t2
=
usec
();
for
(
i
=
0
;
i
<
1000
;
i
++
)
freeReplyObject
(
replies
[
i
]);
free
(
replies
);
printf
(
"
\t
(1000x LRANGE with 500 elements: %.2fs)
\n
"
,
(
t2
-
t1
)
/
1000000
.
0
);
/* Clean DB 9 */
...
...
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