Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZgZdE-0006sj-UC for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2015 14:42:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZgZdE-0004pE-FZ for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2015 14:42:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZgZbv-0003Lz-UJ for pgsql-hackers@postgresql.org; Mon, 28 Sep 2015 14:41:00 +0000 Received: from mbob.nabble.com ([162.253.133.15]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZgZbt-0005Nb-Es for pgsql-hackers@postgresql.org; Mon, 28 Sep 2015 14:40:58 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id AD913167F582 for ; Mon, 28 Sep 2015 07:34:39 -0700 (PDT) Date: Mon, 28 Sep 2015 07:40:54 -0700 (MST) From: zhangjinyu To: pgsql-hackers@postgresql.org Message-ID: <1443451254826-5867647.post@n5.nabble.com> In-Reply-To: <20150927175608.GM295765@alvherre.pgsql> References: <495deb78.4186.1500dacaa63.Coremail.beijing_pg@163.com> <20150927175608.GM295765@alvherre.pgsql> Subject: Re: Patch: Optimize memory allocation in function 'bringetbitmap' MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Yes, I forgot disable-c-assert last test. The following show the test result when disable-c-assert. I think it's still worthwhile. *After optimize code (warm run)* postgres=# select count(*) from lineitem where l_orderkey=1; count ------- 6 (1 row) Time: 327.143 ms *Before optimizing code (warm run)* postgres=# select count(*) from lineitem where l_orderkey=1; count ------- 6 (1 row) Time: 404.323 ms >>>>However I wonder if it would be simpler to have the dtup structure have >>>>the pointers, so that you can pass it as NULL in the first call and then >>>>followup calls reuse the one allocated in the first call. Jinyu: the memory is allocated from perRangeCxt and perRangeCxt will be reset in loop, so this way don't work. Jinyu Zhang -- View this message in context: http://postgresql.nabble.com/Patch-Optimize-memory-allocation-in-function-bringetbitmap-tp5867537p5867647.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers