Greetings,

The following webrev contains fixes for the following issues:

  13110 image catalog rebuild could be faster
  12991 pkg image-create can trigger excessive number of stat calls

webrev:
http://cr.opensolaris.org/~swalker/pkg-13110/

Summary
=======
This set of changes massively improves the performance of both "pkg image-create" and pkg.client.api.refresh() (when there are catalog changes to apply), both by reducing the number of stat calls and simplifying the operations involved.

What follows is a quick summary of performance differences for these operations between gate tip and my workspace. Image was configured with following publishers for a total of 57,543 known package versions (2,030 unique packages), and 774 installed packages using an install of build 128a. Timings below are the best of three executions.

$ pkg -R / publisher
PUBLISHER                             TYPE   STATUS URI
opensolaris.org          (preferred)  origin online http://ipkg../dev
extra                                 origin online http://../extra/
punchin                               origin online http://..
contrib.opensolaris.org  (disabled)   origin online http://../contrib

------------
image-create
------------

old stat
--------
$ truss -c -t stat64 pkg image-create -p opensolaris.org=http://ipkg../dev /tmp/image
syscall               seconds   calls  errors
xstat                    .000       6
stat64                   .683  116127  115831
                     --------  ------   ----
sys totals:              .683  116133 115831
usr time:              68.737
elapsed:               76.800


new stat
--------
$ truss -c -t stat64 pkg image-create -p opensolaris.org=http://ipkg../dev /tmp/image
syscall               seconds   calls  errors
xstat                    .000       6
stat64                   .010    1254     958
                     --------  ------   ----
sys totals:              .010    1260    958
usr time:              11.288
elapsed:               17.440

old timing
----------
$ time pkg image-create -p opensolaris.org=http://ipkg../dev /tmp/image
real    1m12.466s
user    1m8.388s
sys     0m0.993s

new timing
----------
$ time pkg image-create -p opensolaris.org=http://ipkg../dev /tmp/image
real    0m14.295s
user    0m11.349s
sys     0m0.367s

-------------------------------------------------
pkg refresh (and indirectly client.api.refresh())
-------------------------------------------------

old stat
--------
$ pfexec truss -c -t stat64 pkg -R / refresh --full
syscall               seconds   calls  errors
xstat                    .000      10       2
stat64                   .011    1569    1181
                     --------  ------   ----
sys totals:              .012    1579   1183
usr time:              65.497
elapsed:               74.740

new stat
--------
$ pfexec truss -c -t stat64 pkg -R / refresh --full
syscall               seconds   calls  errors
xstat                    .000      10       2
stat64                   .011    1349     959
                     --------  ------   ----
sys totals:              .011    1359    961
usr time:              17.434
elapsed:               23.140

old timing
----------
$ time pfexec pkg -R / refresh --full
real    1m11.306s
user    1m5.587s
sys     0m0.451s

new timing
----------
$ time pfexec pkg -R / refresh --full
real    0m22.038s
user    0m17.473s
sys     0m0.339s


----
You can expect the refresh timings above to be even better for the incremental update cases.
----

Cheers,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to