* 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

@ -463,7 +463,11 @@ xml2ns(cxobj *x,
* no cache was found
* If not, this is devastating when populating deep yang structures
*/
if (ns && nscache_set(x, prefix, ns) < 0)
if (ns &&
#ifdef OPTIMIZE_45_BIND /* Dont set cache if few children: if 1 child typically a body */
xml_child_nr(x) > 1 &&
#endif
nscache_set(x, prefix, ns) < 0)
goto done;
ok:
if (namespace)