* Experimental optimzations of yang-bind and sort for large lists

* Enabled by compile-time options: `OPTIMIZE_45_BIND` and `OPTIMIZE_45_SORT`
This commit is contained in:
Olof hagsand 2020-05-01 17:08:32 +02:00
parent b8ec6a4957
commit 82529a2f16
23 changed files with 215 additions and 51 deletions

View file

@ -223,12 +223,12 @@ main(int argc,
if (xml_bind_yang(x, YB_MODULE, yspec, NULL) < 0)
goto done;
/* sort */
if (xml_apply0(x, CX_ELMNT, xml_sort, h) < 0)
if (xml_sort_recurse(x) < 0)
goto done;
if (xml_apply0(x, -1, xml_sort_verify, h) < 0)
clicon_log(LOG_NOTICE, "%s: sort verify failed", __FUNCTION__);
/* Add default values */
if (xml_apply(x, CX_ELMNT, xml_default, h) < 0)
if (xml_default_recurse(x) < 0)
goto done;
if ((ret = xml_yang_validate_all_top(h, x, &xerr)) < 0)
goto done;

View file

@ -80,7 +80,7 @@ validate_tree(clicon_handle h,
/* should already be populated */
/* Add default values */
if (xml_apply(xt, CX_ELMNT, xml_default, h) < 0)
if (xml_default_recurse(xt) < 0)
goto done;
if (xml_apply(xt, -1, xml_sort_verify, h) < 0)
clicon_log(LOG_NOTICE, "%s: sort verify failed", __FUNCTION__);

View file

@ -261,7 +261,7 @@ main(int argc, char **argv)
xml_print(stderr, x0);
}
if (sort)
xml_apply(xb, CX_ELMNT, xml_sort, h);
xml_sort_recurse(xb);
if (strcmp(xml_name(xb),"top")==0)
clicon_xml2file(stdout, xml_child_i_type(xb, 0, CX_ELMNT), 0, 0);
else

View file

@ -291,11 +291,11 @@ main(int argc,
if (xml_bind_yang(x0, YB_MODULE, yspec, NULL) < 0)
goto done;
/* Sort */
if (xml_apply(x0, CX_ELMNT, xml_sort, h) < 0)
if (xml_sort_recurse(x0) < 0)
goto done;
/* Add default values */
if (xml_apply(x0, CX_ELMNT, xml_default, h) < 0)
if (xml_default_recurse(x0) < 0)
goto done;
if (xml_apply0(x0, -1, xml_sort_verify, h) < 0)
clicon_log(LOG_NOTICE, "%s: sort verify failed", __FUNCTION__);