]> git.evergreen-ils.org Git - Evergreen.git/commit - Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
LP#1836963: reduce the cost of utility functions, speeding up search
authorMike Rylander <mrylander@gmail.com>
Wed, 17 Jul 2019 21:14:01 +0000 (17:14 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 3 Oct 2019 21:24:57 +0000 (17:24 -0400)
commit0dff68634c7a2655f030c7e43e95f774e3c6437c
tree62501188ba06a2effa2b4c0a900ee4a2610a484a
parent1a6b9caf74f59485d34665597e489bd93b19b904
LP#1836963: reduce the cost of utility functions, speeding up search

For large org trees, some several seconds are spent testing org visibility.
The immediate cause is that AppUtils::get_org_tree() does not populate the
process-local cache with a memcache-cached org tree. That only happens when
memcache does not have a copy of the org tree. This is obviously a simple
oversight, which is addressed by making sure any memcache return value
is pushed into the the process local cache.

Additionally, the visibility check is making heavy use of lots of
indirection and delegation to utility code, when some slightly smarter code
could avoid many repeated function calls.  We now supply some local
utility code to flesh and unflesh the parent_ou field of objects in the
org tree, allowing us to avoid using find_org() and instead just calling
parent_ou() when walking "up" the tree.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm