mirror of
https://github.com/json-c/json-c.git
synced 2026-03-25 07:59:07 +08:00
Merge pull request #299 from qlyoung/perf-improvements
Improve json_object -> string performance
This commit is contained in:
@@ -106,8 +106,15 @@ static void test_printbuf_memappend(int *before_resize)
|
||||
printf("Append to just after resize: %d, [%s]\n", printbuf_length(pb), pb->buf);
|
||||
|
||||
free(data);
|
||||
|
||||
printbuf_free(pb);
|
||||
|
||||
#define SA_TEST_STR "XXXXXXXXXXXXXXXX"
|
||||
pb = printbuf_new();
|
||||
printbuf_strappend(pb, SA_TEST_STR);
|
||||
printf("Buffer size after printbuf_strappend(): %d, [%s]\n", printbuf_length(pb), pb->buf);
|
||||
printbuf_free(pb);
|
||||
#undef SA_TEST_STR
|
||||
|
||||
printf("%s: end test\n", __func__);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ Partial append: 3, [blu]
|
||||
With embedded \0 character: 4, [ab]
|
||||
Append to just before resize: 31, [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]
|
||||
Append to just after resize: 32, [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]
|
||||
Buffer size after printbuf_strappend(): 16, [XXXXXXXXXXXXXXXX]
|
||||
test_printbuf_memappend: end test
|
||||
========================================
|
||||
test_sprintbuf: starting test
|
||||
|
||||
Reference in New Issue
Block a user