Revision 653852
Go back to digest for 15th April 2007Optimization in Graphics
Tuomas Suutari committed changes in /trunk/extragear/graphics/kphotoalbum/Utilities:
Optimize Utilities::shuffle(..) and generalize it by making it templated.
Old version was slow when shuffling large string lists, because it did O(n) times random access operation (namely list[index]), which is linear time. => Total complexity O(n^2).
New version uses array instead of list. This makes random access constant time. => Total complexity O(n).
File Changes
Modified 2 files
- /trunk/extragear/graphics/kphotoalbum/Utilities
- /Util.cpp
- /Util.h
2 files changed in total