xbps_transaction_*: multiple performance improvements (v2).
This commit implements multiple performance improvements to the transaction code: - Don't process xbps_pkg_name() N times each time we access its package dictionary (via pkgdb or rpool), just do it once at xbps_pkgdb_init() time. At pkgdb init time, it just creates a property in pkgdb, "pkgname". At rpool time, each time a package is accessed, the "pkgname" string property is added. - The package transaction dictionary contains the "transaction" object to know what's the pkg type. This has been changed to an uint8, this simplifies the logic and it's faster than checking a string object. See xbps_trans_type_t and xbps_transaction_pkg_type(). - Fixed the issue that was marked with XXX in transaction shlibs checking code. This has been fixed and improved and resources are now just freed as expected. - Simplified random code all over the place, avoiding unnecessary allocations or operations. - Rename some transaction files to have a better description. This is my first rototill to the code in 2020.
This commit is contained in:
@ -26,10 +26,6 @@ downgrade_hold_body() {
|
||||
xbps-rindex -d -a $PWD/*.xbps
|
||||
atf_check_equal $? 0
|
||||
cd ..
|
||||
out=$(xbps-install -r root --repository=$PWD/repo -un)
|
||||
set -- $out
|
||||
exp="$1 $2 $3 $4"
|
||||
atf_check_equal "$exp" "A-0.1_1 hold noarch $PWD/repo"
|
||||
xbps-install -r root --repository=$PWD/repo -yuvd
|
||||
atf_check_equal $? 0
|
||||
out=$(xbps-query -r root -p pkgver A)
|
||||
|
@ -26,10 +26,6 @@ update_hold_body() {
|
||||
xbps-rindex -d -a $PWD/*.xbps
|
||||
atf_check_equal $? 0
|
||||
cd ..
|
||||
out=$(xbps-install -r root --repository=$PWD/repo -un)
|
||||
set -- $out
|
||||
exp="$1 $2 $3 $4"
|
||||
atf_check_equal "$exp" "A-1.1_1 hold noarch $PWD/repo"
|
||||
xbps-install -r root --repository=$PWD/repo -yuvd
|
||||
atf_check_equal $? 0
|
||||
out=$(xbps-query -r root -p pkgver A)
|
||||
|
Reference in New Issue
Block a user