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 1oTFAF-0001SD-Rj for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2022 04:17:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTFAE-0007YO-E1 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2022 04:17:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTFAE-0007YF-2m for pgsql-hackers@lists.postgresql.org; Wed, 31 Aug 2022 04:17:18 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oTFAB-0000w1-P4 for pgsql-hackers@postgresql.org; Wed, 31 Aug 2022 04:17:17 +0000 Received: by mail-pj1-x102f.google.com with SMTP id u9-20020a17090a1f0900b001fde6477464so6817707pja.4 for ; Tue, 30 Aug 2022 21:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=L89iAFt+KbEPr0fdozi+O9by89YEqrVuZM2kvNHhbUs=; b=pxEV3qnvxvYlJmsFF1fhJy1fAuYVFQMeq7yDgQOn/Kk+G704B3lHBjHfg/FBXlyAAR FcQbcjzLb9urpD73Rg0ooRwEkmzhP5XsX4I70vpttilpOHCqxUsPLA5Z9RhEHWOQjVvd mfb9frOhcDlRgDrwIZeYGf52oKz7vV+nJYv4h4WTg3U07qMadChHtR1xHtLYne1mAxi2 0x7XiIU2YiOl9O2C3AE/OLOjtQ4OQAx1l8D6oScQmoST/k0A/aP/O8nDEDHMnZ0ZyA4u YREKZZtSd5SRxt5VZWfMyDQ0i2jWHHrGLSnJqe2aG71+KdARFqDWaDjRVrjp2RAJVsJo 3xyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=L89iAFt+KbEPr0fdozi+O9by89YEqrVuZM2kvNHhbUs=; b=gZ668C1ugdhurZnDrboMoYwr68JA+FzARXV0bjbj9jOy+twOE8gegEdBzBV4gDhO82 g7aEhZ8B0NIfvcOeZZK4wiJyLQJHDKJUkZDNW8wV0njLgGX9OPL034j7XRNSdpZQOQ5v yLaTuUghNA1rsunqFsuo9HC86yN985gHTL5oOvOPb2Xs7jYrRHXr8Y4Bv8QCaoSO099v NnWdiliXhjfOeEdS1RkC5K6uf83dXIJyCbFX9feus9YSa5L1f48OAtIFLmSOrMx+OWHr 7qskLDpAm3WLzbnYzSq6jHUrnmdlL/3qtrkQXTGbD+G6IgPixUBwfWYBFj2Y3od/C+YR PjTg== X-Gm-Message-State: ACgBeo2sH5q5PtGX2SUkyAjBM6W6TcTqS9sXDwzbnNLIUMkYK/2VwlkN 9d5Da8GCNdFhYB5eGFrlZ2Y= X-Google-Smtp-Source: AA6agR4VYo3nHDNxE4BQ4JHLgDKjiuLk92VRyOWpukFYLzq4Y1sWi+vuxs0bVz7JJAPNFoDPLTlJiQ== X-Received: by 2002:a17:90b:4d92:b0:1fd:aec0:1c26 with SMTP id oj18-20020a17090b4d9200b001fdaec01c26mr1306845pjb.133.1661919434733; Tue, 30 Aug 2022 21:17:14 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id o18-20020a63e352000000b0042c4d257083sm2413482pgj.25.2022.08.30.21.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 21:17:14 -0700 (PDT) Date: Tue, 30 Aug 2022 21:17:12 -0700 From: Nathan Bossart To: John Naylor Cc: Andres Freund , Tom Lane , Jelte Fennema , "pgsql-hackers@postgresql.org" , Merlin Moncure , Andrew Dunstan , Stephen Frost Subject: Re: [PATCH] Optimize json_lex_string by batching character copying Message-ID: <20220831041712.GA640362@nathanxps13> References: <20220815212304.GA251709@nathanxps13> <20220819204215.GA397534@nathanxps13> <20220821054733.GA780295@nathanxps13> <20220822212229.GA1129243@nathanxps13> <20220823033236.GA1204962@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 31, 2022 at 10:50:39AM +0700, John Naylor wrote: > Here's the final piece. I debated how many tests to add and decided it > was probably enough to add one each for checking quotes and > backslashes in the fast path. There is one cosmetic change in the > code: Before, the vectorized less-equal check compared to 0x1F, but > the byte-wise path did so with < 32. I made them both "less-equal 31" > for consistency. I'll commit this by the end of the week unless anyone > has a better idea about testing. LGTM -- Nathan Bossart Amazon Web Services: https://aws.amazon.com