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

Function parse_xml_benchmark

lib_acl/samples/xml/xml1/xml.c:128–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 "</request>\r\n";
127
128static 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
167static void build_xml(ACL_XML *xml, const char *data)
168{

Callers 1

mainFunction · 0.70

Calls 5

acl_xml_allocFunction · 0.85
acl_xml_slashFunction · 0.85
acl_xml_dumpFunction · 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…