Browse Source
Decrease running time for getStringList (and all other get methods) by looking for configuration entries using binary search rather than linear search through the configuration file. Configuration lines are sorted by section, subsection, name in a sorted list whenever the snapshot is rebuilt. Binary search is used to locate an index in the middle of the values, then walk backwards to find the first value in the range. Given a configuration of file of 5000 distinct section/subsection/name triplets (e.g. a Gerrit Code Review project.config configuration file with 5000 unique access control rules), this new code is faster to lookup each rule individually using getStringList(): old setStringList() 194 usec avg getStringList() 196 usec avg new setStringList() 188 usec avg getStringList() 24 usec avg Change-Id: Ic8907231868c18eb946b72f341a6b58666b70324stable-2.0
Shawn O. Pearce
13 years ago
3 changed files with 167 additions and 39 deletions
Loading…
Reference in new issue