Hi folks,

I finally have round two of my perf work ready.  Please refer to
http://defect.opensolaris.org/bz/show_bug.cgi?id=2344#c1 for the
full perf results, but the punchline is:

                                    OLD CODE      NEW CODE    DIFF
 ----------------------------------------------------------------------
 pkg image-update -n               130.6 sec     103.4 sec    1.2x
 pkg list                           88.8 sec      15.6 sec    5.6x
 pkg list -a                       106.8 sec      32.5 sec    3.2x
 pkg install -n sunstudio           40.4 sec      32.5 sec    1.2x


Please look this over carefully.  I would like at least two reviewers.

   http://cr.opensolaris.org/~dp/fmri-perf

Here are the major changes:

DotSequence:
  - Subclass of list rather than a wrapper around one.  This cuts the
    storage needed for an FMRI by roughly 50%, from 1150 bytes to about
    550.  17% slower to create when done this way (but other operations
    are much faster).
  - Simplified greatly since lists just "do the right thing" for
    comparison, and seem to be a lot faster, see also bug 2363.

Version:
  - Dropped support for pre-ISO timestamps
  - Cleanup of gt and lt
  - Timestamps now stored as strings.

FMRI:
  - 25x speedup in hash implementation
  - Cleanup gt and lt

As part of this, I have developed fmribench.py, which I will also
be checking in.  Also keep in mind that while the perf gains are
nice, as the number of known package versions continues to grow,
performance will continue to suffer, until we get the algorithmic
improvements which Danek has been working on.  My hope is that this
work will help keep the dam from breaking until that point.

I would also like to share what was for me the big lesson here:
think hard when you implement:

        __hash__
        __eq__, __lt__, etc.
        __str__

Thanks,

        -dp

--
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to