| 126 | "</request>\r\n"; |
| 127 | |
| 128 | static void parse_xml_benchmark(int once, int max, const char *data) |
| 129 | { |
| 130 | int i; |
| 131 | ACL_XML *xml = acl_xml_alloc(); |
| 132 | |
| 133 | acl_xml_slash(xml, 1); |
| 134 | |
| 135 | ACL_METER_TIME("-------------bat begin--------------"); |
| 136 | for (i = 0; i < max; i++) { |
| 137 | const char *ptr = data; |
| 138 | |
| 139 | if (once) { |
| 140 | acl_xml_parse(xml, ptr); |
| 141 | } else { |
| 142 | /* ÿ�ν�����һ���ֽ������� xml ���� */ |
| 143 | while (*ptr != 0) { |
| 144 | char ch2[2]; |
| 145 | |
| 146 | ch2[0] = *ptr; |
| 147 | ch2[1] = 0; |
| 148 | acl_xml_parse(xml, ch2); |
| 149 | ptr++; |
| 150 | } |
| 151 | } |
| 152 | if (i < 2 || i == 4) { |
| 153 | printf("--------- dump xml --------------\n"); |
| 154 | acl_xml_dump(xml, ACL_VSTREAM_OUT); |
| 155 | printf("--------- data src --------------\n"); |
| 156 | printf("%s", data); |
| 157 | printf("--------- dump end --------------\n"); |
| 158 | } |
| 159 | |
| 160 | |
| 161 | acl_xml_reset(xml); |
| 162 | } |
| 163 | ACL_METER_TIME("-------------bat end--------------"); |
| 164 | acl_xml_free(xml); |
| 165 | } |
| 166 | |
| 167 | static void build_xml(ACL_XML *xml, const char *data) |
| 168 | { |
no test coverage detected
searching dependent graphs…