summaryrefslogtreecommitdiff
path: root/src/btree/bt_stat.c
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@wiredtiger.com>2011-07-14 13:28:47 -0400
committerKeith Bostic <keith.bostic@wiredtiger.com>2011-07-14 13:28:47 -0400
commit03947f5c22713138c1bf80f58fa438350d420bd4 (patch)
treeda35b681376cc5999041851da4abcc322b2eebf4 /src/btree/bt_stat.c
parentb66cef61bc30730e6a0351f173ce5541af5b34e9 (diff)
downloadmongo-03947f5c22713138c1bf80f58fa438350d420bd4.tar.gz
Replace N different cell extraction functions with a single cell_unpack
function. Since the cell likely points onto the on-disk page, each request for a cell field is likely to miss in the cache, it's better to do it all at once. Leave a cell-type function for the few cases where all I care about is the cell's type. --HG-- extra : rebase_source : 2e68f650381035f9ee55e18c4c90a389d11230d0
Diffstat (limited to 'src/btree/bt_stat.c')
-rw-r--r--src/btree/bt_stat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index 712ba1a2b23..013fa9cea60 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -152,12 +152,14 @@ static int
__wt_stat_page_col_var(WT_SESSION_IMPL *session, WT_PAGE *page)
{
WT_BTREE_FILE_STATS *stats;
+ WT_CELL *cell;
+ WT_CELL_UNPACK *unpack, _unpack;
WT_COL *cip;
WT_UPDATE *upd;
uint32_t i;
- void *cipdata;
stats = session->btree->fstats;
+ unpack = &_unpack;
/*
* Walk the page, counting regular and overflow data items, and checking
@@ -167,12 +169,12 @@ __wt_stat_page_col_var(WT_SESSION_IMPL *session, WT_PAGE *page)
* there's Huffman encoding).
*/
WT_COL_FOREACH(page, cip, i) {
- cipdata = WT_COL_PTR(page, cip);
- if (cipdata == NULL) {
+ if ((cell = WT_COL_PTR(page, cip)) == NULL) {
WT_STAT_INCR(stats, file_item_col_deleted);
continue;
}
- switch (__wt_cell_type(cipdata)) {
+ __wt_cell_unpack(session, cell, unpack);
+ switch (unpack->type) {
case WT_CELL_DATA:
case WT_CELL_DATA_OVFL:
upd = WT_COL_UPDATE(page, cip);