libxbps: performance improvements by caching the most accessed paths.
1- We can cache the result of the first xbps_pkgdb_init() when it fails and avoid the malloc/free/access from it. 2- We cache the uname(2) result into a private var in xbps_handle and use it in xbps_pkg_arch_match(). This improves performance by ~5% approx and it's close as it was before introducing the repository index format 1.5.
This commit is contained in:
@@ -66,7 +66,7 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
|
||||
/*
|
||||
* Check if current pkg conflicts with any pkg in transaction.
|
||||
*/
|
||||
pkgd = xbps_find_pkg_in_dict_by_pattern(xhp->transd,
|
||||
pkgd = xbps_find_pkg_in_dict_by_pattern(xhp, xhp->transd,
|
||||
"unsorted_deps", cfpkg);
|
||||
if (pkgd != NULL) {
|
||||
prop_dictionary_get_cstring_nocopy(pkgd,
|
||||
|
Reference in New Issue
Block a user