Revision 04c14ef...
Go back to digest for 30th January 2011Optimization in Utilities
Jonathan Michael Thomas committed changes in [libqapt] src/package.cpp:
OPTIMIZE: Much of a package's state is guaranteed-static between backend reloads. This means that we can calculate these static flags once on the first time state() is called and store the result for subsequent calls to Package::state()
After Package::state() has been called at least once, subsequent calls will be sped up by 66%. And since we already had an int where we were tracking pin/version override flags, we can use this int to store the static flags and not increase memory usage a bit.
Muon spent half as long inside Package::state() on startup with this optimization. (3% total ->1.5% total time)
File Changes
Modified 1 files
- src/package.cpp
1 files changed in total