apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Zhakov <i...@visualsvn.com>
Subject Re: Pool freelist
Date Thu, 04 Sep 2014 11:03:28 GMT
On 3 September 2014 23:37, Jim Jagielski <jim@jagunet.com> wrote:
> Yeah, that thread, and Greg's work w/ pocore, are kind of
> the origins of this question. The thing is that awhile ago,
> (I mean way awhile ago), I recall us trying to simply replace
> pools w/ malloc/free (Paul was the main dude in this case)
> and we got terrible performance...
Simply replacing pools within malloc/free is not good idea IMO,
because nice thing about pools that it has very good performance for
small allocations because data allocated with minimum 8kb chunks. So
it benefits for typical code like this:
[[
some_t *s = apr_pcalloc(pool, sizeof(*s));
s->string1 = apr_pstrdup(pool, s);
s->something = arp_pcalloc(pool, 11)
]]

-- 
Ivan Zhakov

Mime
View raw message