]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Aggregate hot Iterator counters in LocalStatistics (DBIter::Next perf regression)
authorIslam AbdelRahman <tec@fb.com>
Sat, 12 Mar 2016 03:01:12 +0000 (19:01 -0800)
committerAndrew Kryczka <andrewkr@fb.com>
Mon, 14 Mar 2016 18:11:09 +0000 (11:11 -0700)
commit0612f472b2dce66b36ccdd4e6fb9b4a4edf6b9e1
tree32f2fa592bb446289afcd5450f59467bbe9dd924
parent187cb23caa9b0d001da91b52ea641dbc123fc9d3
Aggregate hot Iterator counters in LocalStatistics (DBIter::Next perf regression)

Summary:
This patch bump the counters in the frequent code path DBIter::Next() / DBIter::Prev() in a local data members and send them to Statistics when the iterator is destroyed
A better solution will be to have thread_local implementation for Statistics

New performance
```
readseq      :       0.035 micros/op 28597881 ops/sec; 3163.7 MB/s
     1,851,568,819      stalled-cycles-frontend   #   31.29% frontend cycles idle    [49.86%]
       884,929,823      stalled-cycles-backend    #   14.95% backend  cycles idle    [50.21%]
readreverse  :       0.071 micros/op 14077393 ops/sec; 1557.3 MB/s
     3,239,575,993      stalled-cycles-frontend   #   27.36% frontend cycles idle    [49.96%]
     1,558,253,983      stalled-cycles-backend    #   13.16% backend  cycles idle    [50.14%]

```

Existing performance

```
readreverse  :       0.174 micros/op 5732342 ops/sec;  634.1 MB/s
    20,570,209,389      stalled-cycles-frontend   #   70.71% frontend cycles idle    [50.01%]
    18,422,816,837      stalled-cycles-backend    #   63.33% backend  cycles idle    [50.04%]

readseq      :       0.119 micros/op 8400537 ops/sec;  929.3 MB/s
    15,634,225,844      stalled-cycles-frontend   #   79.07% frontend cycles idle    [49.96%]
    14,227,427,453      stalled-cycles-backend    #   71.95% backend  cycles idle    [50.09%]
```

Test Plan: unit tests

Reviewers: yhchiang, sdong, igor

Reviewed By: sdong

Subscribers: andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D55107
HISTORY.md
db/db_iter.cc
db/db_test.cc