Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEJdo-0004qk-23 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 21:53:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kEJdl-0000MD-OW for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 21:53:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEJdl-0000M6-HD for pgsql-hackers@lists.postgresql.org; Fri, 04 Sep 2020 21:53:01 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kEJdi-0008LT-Lo for pgsql-hackers@postgresql.org; Fri, 04 Sep 2020 21:53:00 +0000 Received: by mail-qt1-x842.google.com with SMTP id n10so5897555qtv.3 for ; Fri, 04 Sep 2020 14:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=CEH3I4OUBv/FUaCjsyWaK5Ppw4ZMlMb6VT2Be2L+JGM=; b=sO23S2P+wqoEl7KwFxV+Mr84pRz/fAmisVsNAkn78KVxz5YinjvyTAdz0U8/eBvGI4 HecfmPHDkrc0pCE2D46uZf5TIxxRZXobkKS8bDO1dYYDBVOIQ8E/EchG/Xk3a2fImBw0 POiR3PX6cvv6fz8T4syGMNPeSDW7Vsrqy4wplqXznRI3aypP6tkMCUviXlNo9g47FW5L vLo42cMW2JGNoiIxf5BDXZaDGRarbPoF6b7KiCu9i7mWwQxe5f1zdk6BQ3FBVCobxGue AnmjMtZghEgpfb70zsxNmUMud3Pv4D5/9jrys4/10bReeDFs3HD/z8Zq0EHIkGIlyrkf lUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=CEH3I4OUBv/FUaCjsyWaK5Ppw4ZMlMb6VT2Be2L+JGM=; b=TpxRM6UKhTKjROxl6gCFvl7iVZ8Lx5nLJojElAcn7wB0YU2jO3bJaZYLQpGRRANqAx 3KvPtv2svHplZ7h6wcw43qE4cGiL4nS5SVyWmk71rqVIIG45VobLeQ00FXMk0lyDzcza ++EZ6953/aAN/kTLYm/ZLhkKyVKnqo/cseqjyUjlr6fN+TrXZ7w56o5ijyeCiwEVF/L/ fa65MG7bOzjnmUKdilHXnv+TuWVoO2JxnSvcUZMb8SnccXVWo5lw3MlUAAUxCu5ReEU2 0TGrmXkRRV5WXJs9xpIXKYkUlRHhSzK9MFAlisk6pqQ/cUmpZcsM3hP5qPMJ1yQTMSGe tQcg== X-Gm-Message-State: AOAM5314RPDG0t9av0Volcys0ezamfk+BGwss5i6XbnQZkvIhd6mdIBl Fs13P6qb7MdWEhlPPtV9afYuIw== X-Google-Smtp-Source: ABdhPJykp7XupfZ4qUQMXbgQQl2HiDHt6J4Fa46rHlMkaWeAixencbfWN8n7iC+Qj4o4NYK3jXAyNw== X-Received: by 2002:aed:2d06:: with SMTP id h6mr10534846qtd.301.1599256376883; Fri, 04 Sep 2020 14:52:56 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id o2sm1424320qkk.42.2020.09.04.14.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 14:52:56 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id CC0B92A1549; Fri, 4 Sep 2020 17:52:54 -0400 (-04) Date: Fri, 4 Sep 2020 17:52:54 -0400 From: Alvaro Herrera To: Tom Lane Cc: Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha , Thomas Munro , pgsql-hackers Subject: Re: A micro-optimisation for walkdir() Message-ID: <20200904215254.GA24145@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <968019.1599255574@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Sep-04, Tom Lane wrote: > I think that it's standard to test for such symbols by seeing > if they're defined as macros ... not least because that's the *only* > way to test their existence in C. I guess since what we're doing is emulating standard readdir(), that makes sense. > Personally, what I'd do is lose the enum and just define the macros > with simple integer constant values. WFM. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services