The get_properties() method uses a recursive function, which depending on the recursion size costs performance by a growing stack. This can be replaced with a simple loop and a queue. A benchmark showed: > Recursive version total time: 0.103486 seconds > Iterative version total time: 0.084145 seconds > Recursive avg time per call: 0.000103486 seconds (103.486 microseconds) > Iterative avg time per call: 0.000084145 seconds (84.145 microseconds) > Iterative version is FASTER by 0.019341 seconds (18.69%). > Iterative version is approx 1.23 times faster.
I tested it also for a regular domain user, a few requests and picked the best one: Before: Best of 10-20 requests: # time curl -s -H 'Accept: application/json' 'http://Administrator:univention@localhost/univention/udm/users/user/uid=foo,'$(ucr get ldap/base) > /dev/null real 0m0,096s user 0m0,063s sys 0m0,019s After: Best of 10-20 requests: # time curl -s -H 'Accept: application/json' 'http://Administrator:univention@localhost/univention/udm/users/user/uid=foo,'$(ucr get ldap/base) > /dev/null real 0m0,082s user 0m0,062s sys 0m0,012s improve: 13 %
A stack based dequeue is now used. univention-management-console-module-udm.yaml 5d0778eb69f3 | perf(udm-umc): speed up get_properties by removing recursion univention-management-console-module-udm (12.0.10) 24d27046f533 | perf(udm-umc): fix manual-list-comprehension PERF401 5d0778eb69f3 | perf(udm-umc): speed up get_properties by removing recursion
OK - yaml OK - get_properties() still works OK - slightly faster
<https://errata.software-univention.de/#/?erratum=5.2x115>