| 310 | } |
| 311 | |
| 312 | static 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 | |
| 359 | static ACL_XML *get_xml(int once, const char *data, |
| 360 | const char* root, int multi_root) |
no test coverage detected
searching dependent graphs…