Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D531918C27 for ; Sun, 4 Oct 2015 13:22:46 +0000 (UTC) Received: (qmail 7795 invoked by uid 500); 4 Oct 2015 13:22:46 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 7762 invoked by uid 500); 4 Oct 2015 13:22:46 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 7752 invoked by uid 99); 4 Oct 2015 13:22:46 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2015 13:22:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 454751809BF for ; Sun, 4 Oct 2015 13:22:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.994 X-Spam-Level: X-Spam-Status: No, score=0.994 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id AtKFWSCc2O5B for ; Sun, 4 Oct 2015 13:22:45 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 49A9142AB6 for ; Sun, 4 Oct 2015 13:22:45 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C6E1BE0280 for ; Sun, 4 Oct 2015 13:22:44 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id C4B623A022F for ; Sun, 4 Oct 2015 13:22:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1706675 - /subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Date: Sun, 04 Oct 2015 13:22:44 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151004132244.C4B623A022F@svn01-us-west.apache.org> Author: stefan2 Date: Sun Oct 4 13:22:44 2015 New Revision: 1706675 URL: http://svn.apache.org/viewvc?rev=1706675&view=rev Log: Avoid directory cache misses in FSFS in early stages of a transaction. * subversion/libsvn_fs_fs/cached_data.c (locate_dir_cache): As long as the dir representation has not been touched, we will only find it in the committed dir cache. Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1706675&r1=1706674&r2=1706675&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original) +++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Sun Oct 4 13:22:44 2015 @@ -2636,27 +2636,27 @@ locate_dir_cache(svn_fs_t *fs, apr_pool_t *pool) { fs_fs_data_t *ffd = fs->fsap_data; - if (svn_fs_fs__id_is_txn(noderev->id)) + if (!noderev->data_rep) + { + /* no data rep -> empty directory. + A NULL key causes a cache miss. */ + *key = NULL; + return ffd->dir_cache; + } + + if (svn_fs_fs__id_txn_used(&noderev->data_rep->txn_id)) { /* data in txns requires the expensive fs_id-based addressing mode */ *key = svn_fs_fs__id_unparse(noderev->id, pool)->data; + return ffd->txn_dir_cache; } else { /* committed data can use simple rev,item pairs */ - if (noderev->data_rep) - { - pair_key->revision = noderev->data_rep->revision; - pair_key->second = noderev->data_rep->item_index; - *key = pair_key; - } - else - { - /* no data rep -> empty directory. - A NULL key causes a cache miss. */ - *key = NULL; - } + pair_key->revision = noderev->data_rep->revision; + pair_key->second = noderev->data_rep->item_index; + *key = pair_key; return ffd->dir_cache; }