Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7422

Optimize FieldRangeSet::range()

      Replace 3 O(log n) operations with 1 for mutable FieldRange objects:

           inline FieldRange &FieldRangeSet::range( const char *fieldName ) {
      -        map<string,FieldRange>::iterator f = _ranges.find( fieldName );
      -        if ( f == _ranges.end() ) {
      -            _ranges.insert( make_pair( string( fieldName ), universalRange() ) );
      -            return _ranges.find( fieldName )->second;
      -        }
      -        return f->second;
      +        return _ranges.insert(make_pair(string(fieldName), universalRange())).first->second;
           }
      

      Should help mongos and mongod – see 'nolog' call graphs in SERVER-7331.

            Assignee:
            Unassigned Unassigned
            Reporter:
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: