* 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

@ -97,9 +97,9 @@ clixon_xvec_inc(clixon_xvec *xv)
if (xv->xv_max < XVEC_MAX_DEFAULT)
xv->xv_max = XVEC_MAX_DEFAULT;
else if (xv->xv_max < XVEC_MAX_THRESHOLD)
xv->xv_max *= 2;
xv->xv_max *= 2; /* Double the space - exponential */
else
xv->xv_max += XVEC_MAX_THRESHOLD;
xv->xv_max += XVEC_MAX_THRESHOLD; /* Add - linear growth */
if ((xv->xv_vec = realloc(xv->xv_vec, sizeof(cxobj *) * xv->xv_max)) == NULL){
clicon_err(OE_XML, errno, "realloc");
goto done;