* Added option: CLICON_CLI_BUF_START and CLICON_CLI_BUF_THRESHOLD so you can change the start and

threshold of quadratic and linear growth of CLIgen buffers (cbuf:s)
* Memory footprint
  * Do not autopopulate namespace cache, instead use on-demand, see `xml2ns()`.
  * Set CBUF start level to 256 (`CLICON_CLI_BUF_START` option)
  * Reduced xml child vector default size from 4 to 1 with quadratic growoth to 64K then linear
This commit is contained in:
Olof hagsand 2020-03-04 11:27:43 +01:00
parent 250ead517c
commit 0f54899ae4
17 changed files with 393 additions and 124 deletions

View file

@ -217,6 +217,7 @@ xml_cmp(cxobj *x1,
goto done;
}
}
/* Here x1 and x2 are same type */
y1 = xml_spec(x1);
y2 = xml_spec(x2);
if (same){
@ -1034,13 +1035,15 @@ xml_sort_verify(cxobj *x0,
retval = 1;
goto done;
}
xml_enumerate_children(x0);
while ((x = xml_child_each(x0, x, -1)) != NULL) {
if (xprev != NULL){ /* Check xprev <= x */
if (xml_cmp(xprev, x, 1, 0, NULL) > 0)
goto done;
if (xml_type(x0) == CX_ELMNT){
xml_enumerate_children(x0);
while ((x = xml_child_each(x0, x, -1)) != NULL) {
if (xprev != NULL){ /* Check xprev <= x */
if (xml_cmp(xprev, x, 1, 0, NULL) > 0)
goto done;
}
xprev = x;
}
xprev = x;
}
retval = 0;
done: