* A yang type regex cache added, this helps the performance by avoiding re-running the regcomp command on every iteration.

* An XML namespace cache added (see `xml2ns()`)
* Better performance of XML whitespace parsing/scanning.
This commit is contained in:
Olof hagsand 2019-04-19 16:01:39 +02:00
parent 728c97ab6d
commit 8c36083e16
8 changed files with 214 additions and 19 deletions

View file

@ -114,6 +114,7 @@ db_merge(clicon_handle h,
/*! Clixon startup startup mode: Commit startup configuration into running state
* @param[in] h Clixon handle
* @param[in] db tmp or startup
* @param[out] cbret If status is invalid contains error message
* @retval -1 Error
* @retval 0 Validation failed
@ -150,6 +151,10 @@ startup_mode_startup(clicon_handle h,
int retval = -1;
int ret;
if (strcmp(db, "running")==0){
clicon_err(OE_FATAL, 0, "Invalid startup db: %s", db);
goto done;
}
/* Load plugins and call plugin_init() */
if (backend_plugin_initiate(h) != 0)
goto done;
@ -255,6 +260,8 @@ startup_extraxml(clicon_handle h,
goto done;
if (ret == 0)
goto fail;
if (xt==NULL /* || xml_child_nr(xt)==0 */ ) /* This gives SEGV in test_feature */
goto ok;
/* Write (potentially modified) xml tree xt back to tmp
*/
if ((ret = xmldb_put(h, "tmp", OP_REPLACE, xt,
@ -265,6 +272,7 @@ startup_extraxml(clicon_handle h,
goto fail;
if (ret == 0)
goto fail;
ok:
retval = 1;
done:
if (xt)