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

Function parse_xml_benchmark

lib_acl/samples/xml/xml2/main.c:312–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312static void parse_xml_benchmark(int once, int max, const char *data)
313{
314 int i;
315 ACL_XML *xml = acl_xml_alloc();
316
317 acl_xml_slash(xml, 1);
318 acl_xml_multi_root(xml, 1);
319
320 ACL_METER_TIME("-------------bat begin--------------");
321 for (i = 0; i < max; i++) {
322 const char *ptr = data;
323
324 if (once) {
325 acl_xml_parse(xml, ptr);
326 } else {
327 /* ÿ�ν�����һ���ֽ������� xml ���� */
328 while (*ptr != 0) {
329 char ch2[2];
330
331 ch2[0] = *ptr;
332 ch2[1] = 0;
333 acl_xml_parse(xml, ch2);
334 ptr++;
335 }
336 }
337 /*
338 if (i < 2 || i == 4) {
339 printf("--------- dump xml --------------\n");
340 acl_xml_dump(xml, ACL_VSTREAM_OUT);
341 printf("--------- data src --------------\n");
342 printf("%s", data);
343 printf("--------- dump end --------------\n");
344 }
345 */
346
347 acl_xml_reset(xml);
348 }
349
350 ACL_METER_TIME("-------------bat end--------------");
351 acl_xml_free(xml);
352
353 printf("-----------------benchmark_max: %d----------------\r\n", max);
354
355 printf("Enter any key to continue ...\r\n");
356 getchar();
357}
358
359static ACL_XML *get_xml(int once, const char *data,
360 const char* root, int multi_root)

Callers 1

mainFunction · 0.70

Calls 5

acl_xml_allocFunction · 0.85
acl_xml_slashFunction · 0.85
acl_xml_multi_rootFunction · 0.85
acl_xml_resetFunction · 0.85
acl_xml_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…