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 1oQEsY-0003CV-Sh for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Aug 2022 21:22:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQEsW-0003Ca-Oq for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Aug 2022 21:22:36 +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 1oQEsW-0003CR-E1 for pgsql-hackers@lists.postgresql.org; Mon, 22 Aug 2022 21:22:36 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oQEsT-0000Kv-T1 for pgsql-hackers@postgresql.org; Mon, 22 Aug 2022 21:22:36 +0000 Received: by mail-pl1-x62a.google.com with SMTP id g8so7179786plq.11 for ; Mon, 22 Aug 2022 14:22:33 -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=ZY+zLbhxeiwOyNwQBInxZClkboDH/77iapRJm7XmGnY=; b=is0vbQ6y4t3p1/fqaMePTtGpiIGsyGr9QQdZ4Vu0Cg8OqtbeowNfnPgV24FjD4zaCn t6gcTzGQLTUdtZt2Y8VrF2Sqt2T00w6DGJFhpJcZf6uSkq2knTCcZ82HQwVIlhe13jUP /JhQLDukjUfC4iTIj5If3RLJzt6JpJAJce655QLyZoSdXld5PK3kuwMOgmChV1L/eYAt 9D16OCGAZLu6pSG3vNbePWMOt2bITLUvnNyQBEeLckKdR3Tt23CgMwFc40GxHukA+jh8 rwl/5K3TrucB7C/+kBe+hYAh9sy7eIauNouwVyai+ULs+DcD8EewxbVOC83GLrbkbtRs JnIQ== 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=ZY+zLbhxeiwOyNwQBInxZClkboDH/77iapRJm7XmGnY=; b=JQJ/Xb3O69ZwAZow9DmDaOYwXE2tq7SEptezk9c+CVW9w23rhis1NVFQ/YzZEoAP0a ih16NLX0xaaGMuEOqMqn+u85OJvmoSRiDTLgySuLc6ajGQk2xqHHZgDxdEJ2pDfPFlUn dxjkhp4uGZmION1GfNKg4ENXZK3+OzBn/4Qo4AAUJsPzl6P/AER+EMPBMIe4abr4d85B WafIdRi0g9qP2PogycVcLGDbC9iDesoGGjBRKQBLouMmi/8NyLzv73WQidTsV+0fL0K3 3ZwlM6sz7QS4sPUCXcRwfCEdpFL1vVjmzhSnVWx3pO+Woy3o+PVNndJqwfg7uDAh6Wk6 BQQQ== X-Gm-Message-State: ACgBeo26WBDUT924V57AmSWxfyFsYKBJk/FPAMiry7XpX2x4FTnBAmKp cXzTfK3vIEkcFxTX54wKKh8= X-Google-Smtp-Source: AA6agR6u2VgbPWtENFYbg6d21AhbFecRmSNXX698hkPWnHMGTAJxjywo5Ba93v97VG1RTVLEnMywsQ== X-Received: by 2002:a17:90b:3904:b0:1fb:215c:844a with SMTP id ob4-20020a17090b390400b001fb215c844amr239370pjb.5.1661203351803; Mon, 22 Aug 2022 14:22:31 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id d5-20020a170902654500b00172bd7505e6sm7322703pln.12.2022.08.22.14.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 14:22:31 -0700 (PDT) Date: Mon, 22 Aug 2022 14:22:29 -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: <20220822212229.GA1129243@nathanxps13> References: <20220711154150.hwzw7qw2k6iahofy@awork3.anarazel.de> <1119852.1657554806@sss.pgh.pa.us> <20220711160728.tljbnowfgxefdbli@awork3.anarazel.de> <20220815212304.GA251709@nathanxps13> <20220819204215.GA397534@nathanxps13> <20220821054733.GA780295@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 Mon, Aug 22, 2022 at 09:35:34AM +0700, John Naylor wrote: > Not at all! However, the 32-bit-element changes are irrelevant for > json, and make review more difficult. I would suggest keeping those in > the other thread starting with whatever refactoring is needed. I can > always rebase over that. Yeah, I'll remove those to keep this thread focused. > - I like the idea of simplifying the assertions, but I can't get > behind using platform lfind to do it, since it has a different API, > requires new functions we don't need, and possibly has portability > issues. A simple for-loop is better for assertions. My main goal with this was improving readability, which is likely possible without lfind(). I'll see what I can do. > - A runtime elog is not appropriate for a compile time check -- use > #error instead. Will do. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com