Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F356618ECB for ; Tue, 24 Nov 2015 16:15:45 +0000 (UTC) Received: (qmail 74188 invoked by uid 500); 24 Nov 2015 16:15:45 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 74122 invoked by uid 500); 24 Nov 2015 16:15:45 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 74112 invoked by uid 99); 24 Nov 2015 16:15:45 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2015 16:15:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B8757C2D16 for ; Tue, 24 Nov 2015 16:15:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id mINH8ADUFHOb for ; Tue, 24 Nov 2015 16:15:38 +0000 (UTC) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.53]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 9484E25E37 for ; Tue, 24 Nov 2015 16:15:37 +0000 (UTC) Received: by qgea14 with SMTP id a14so13672067qge.0 for ; Tue, 24 Nov 2015 08:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FP0V1/naYCwO4the7iOQChtuTEeCGpAaBdCeyCO9GCA=; b=PENOv4yAkkCsMoQBDVMLAXeYYoE98bhg+SJa5VlwwJ9WXDmEN6WylkzvJJugMg3OUX q6GheAW/fmft0N0nCXwQXzlh03xMvhOCLoI5xopH+JFIj0pd1i62iKXWowTNGo5nc+Nw f7p0TeOJ/2mNBEtQkK6YkhT6XKll9MJJDFBnDAiyRAVOjC3D1imMe8FsYWtaPDQ57yTd yySi5qjSB2ou2lRNb5/AfEMc43awHl+1S4WwkaTMJsqsigle6Wu9EmIin9ZUV91zL93N GoBnf1LwFATTf9SoOaiFTaJ83Fp8wcZdODx2sGfbmANfC9Pi2XznBAVxg10NhpG99lnF voJA== MIME-Version: 1.0 X-Received: by 10.140.220.136 with SMTP id q130mr31048757qhb.24.1448381736705; Tue, 24 Nov 2015 08:15:36 -0800 (PST) Received: by 10.55.101.84 with HTTP; Tue, 24 Nov 2015 08:15:36 -0800 (PST) In-Reply-To: <3F16527F-A2FE-4CEE-A87C-E98BB6DF07ED@sharp.fm> References: <20151123200516.D444B3A043E@svn01-us-west.apache.org> <3F16527F-A2FE-4CEE-A87C-E98BB6DF07ED@sharp.fm> Date: Tue, 24 Nov 2015 17:15:36 +0100 Message-ID: Subject: Re: svn commit: r1715938 - /httpd/httpd/trunk/modules/cache/cache_util.c From: Yann Ylavic To: httpd-dev Content-Type: text/plain; charset=UTF-8 On Tue, Nov 24, 2015 at 5:09 PM, Graham Leggett wrote: > > A further optimisation - in many cases the fast path is really a case sensitive string comparison, given that the vast majority of the time the case being used is the case quoted in the spec. > > In other words, while mAx-AgE is valid, it is almost always max-age. > > Does it make sense to do a case sensitive comparison first, and then fall back to case insensitive? Not sure: if (!strcmp(h, "max-age") || ap_cmpcasestr(h, "max-age")) is likely to be a bit faster than a single ap_cmpcasestr() when it matches, but much slower when it does not. Regards, Yann.