MCPcopy Create free account
hub / github.com/acl-dev/acl / test_json_benchmark

Function test_json_benchmark

lib_acl/samples/json/json5/main.cpp:38–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36#endif
37
38static void test_json_benchmark(int max)
39{
40 cJSON *json;
41
42 ACL_METER_TIME("-------------bat begin--------------");
43
44 for (int i = 0; i < max; i++)
45 {
46 const char* ptr = default_data;
47 json = cJSON_Parse(ptr);
48 if (json == NULL)
49 {
50 printf("parse error: %s\r\n", ptr);
51 break;
52 }
53 cJSON_Delete(json);
54 }
55
56 ACL_METER_TIME("-------------bat end--------------");
57}
58
59static int benchmark_max = 100;
60

Callers 1

thread_funcFunction · 0.70

Calls 2

cJSON_ParseFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…