pg.ddx.io pgsql-hackers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <stark@mit.edu>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: can we optimize STACK_DEPTH_SLOP
Date: Wed, 06 Jul 2016 21:45:36 -0400
Message-ID: <20280.1467855936@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM-w4HMiJKdjX=7SZj5OTtK7-VkznVbwsC1km=4X=Y0=0rej2w@mail.gmail.com>
References: <CAM-w4HMwwcwaVvYcAH0_FGtG5GeXdYVRfvG81pXnSJWHnCfosQ@mail.gmail.com>
<32729.1467734050@sss.pgh.pa.us>
<CA+TgmoYubk9mjX9Vjb7dki9JZWwoW-X5pLhwPaN=jv_MD9b_Sw@mail.gmail.com>
<28549.1467748100@sss.pgh.pa.us>
<CAM-w4HN_U4CDuneDkXua4+Txhci5HNxkCRsCG78EkETzDQp-ZQ@mail.gmail.com>
<19108.1467812089@sss.pgh.pa.us>
<CAM-w4HPJr_bAWAmJ95Bwko6c31v6XY5hx8xyn5hL_JGO0OWP3Q@mail.gmail.com>
<CAM-w4HMiJKdjX=7SZj5OTtK7-VkznVbwsC1km=4X=Y0=0rej2w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Greg Stark <stark@mit.edu> writes:
> Ok, I managed to get __atribute__((destructor)) working and capitured
> the attached pmap output for all the revisions. You can see the git
> revision in the binary name along with a putative date though in the
> case of branches the date can be deceptive. It looks to me like REL8_4
> is already bloated by REL8_4_0~2268 (which means 2268 commits *before*
> the REL8_4_0 tag -- i.e. soon after it branched).
I traced through this by dint of inserting a lot of system("pmap") calls,
and what I found out is that it's the act of setting one of the timezone
variables that does it. This is because tzload() allocates a local
variable "union local_storage ls", which sounds harmless enough, but
in point of fact the darn thing is 78K! And to add insult to injury,
with my setting (US/Eastern) there is a recursive call to parse the
"posixrules" timezone file. So that's 150K worth of stack right
there, although possibly it's only half that for some zone settings.
(And if you use "GMT" you escape all of this, since that's hard coded.)
So now I understand why the IANA code has provisions for malloc'ing
that storage rather than just using the stack. We should do likewise.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (16+ messages) latest in thread
Message-ID: <20280.1467855936@sss.pgh.pa.us> Permalink: ../20280.1467855936@sss.pgh.pa.us/ Also on: postgresql.org/message-id/20280.1467855936@sss.pgh.pa.us ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-hackers@postgresql.org Cc: tgl@sss.pgh.pa.us, stark@mit.edu, robertmhaas@gmail.com Subject: Re: can we optimize STACK_DEPTH_SLOP In-Reply-To: <20280.1467855936@sss.pgh.pa.us> References: <CAM-w4HMwwcwaVvYcAH0_FGtG5GeXdYVRfvG81pXnSJWHnCfosQ@mail.gmail.com> <32729.1467734050@sss.pgh.pa.us> <CA+TgmoYubk9mjX9Vjb7dki9JZWwoW-X5pLhwPaN=jv_MD9b_Sw@mail.gmail.com> <28549.1467748100@sss.pgh.pa.us> <CAM-w4HN_U4CDuneDkXua4+Txhci5HNxkCRsCG78EkETzDQp-ZQ@mail.gmail.com> <19108.1467812089@sss.pgh.pa.us> <CAM-w4HPJr_bAWAmJ95Bwko6c31v6XY5hx8xyn5hL_JGO0OWP3Q@mail.gmail.com> <CAM-w4HMiJKdjX=7SZj5OTtK7-VkznVbwsC1km=4X=Y0=0rej2w@mail.gmail.com> <20280.1467855936@sss.pgh.pa.us> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox