_slot_operator_update_probe: memoize use_reduce (529660)

Memoize the results of use_reduce calls inside
_slot_operator_update_probe, in order to improve performance. With
memoization, 'emerge -puvDN @world' on one of my computers takes
22.4% less time, and results in 13.5% fewer use_reduce calls.

X-Gentoo-Bug: 529660
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=529660
Acked-by: Brian Dolbec <dolsen@gentoo.org>
_select_pkg_highest_available: selective cache invalidation (530010)

Implement selective invalidation of cache for the
depgraph._select_pkg_highest_available method, so that the entire cache
is not discarded whenever a package is added to the graph. On one of my
computers with this patch, 'emerge -puvDN @world' takes 15% less time,
and results in 58% fewer _select_pkg_highest_available_imp calls.

X-Gentoo-Bug: 530010
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=530010
Acked-by: Alexander Berntsen <bernalex@gentoo.org>