public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: DJ Delorie <dj@redhat.com>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Subject: Re: [PATCH] malloc: Use correct C11 atomics for fastbin
Date: Thu, 15 Dec 2022 15:43:43 +0000	[thread overview]
Message-ID: <PAWPR08MB8982FFE53EF1BE027040839883E19@PAWPR08MB8982.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <xncz8w5wml.fsf@greed.delorie.com>

Hi DJ,

> If testing shows that a larger default makes sense across a wide range
> of applications, then we can change the default.  I'm a bit opposed to
> changing anything because "it makes sense".  Back it up with data.

Larger values result in major speedups. Even a very conservative increase
to 50 speeds up xalancbmk up by 5% and omnetpp by 1.3%. A value of
2000 gives 17.5% and 6% respectively, but performance increases continue
well beyond that.

> tcache is wide but shallow, fastbins are narrow but deep (tcache caches
> much larger chunks than fastbins do) Benchmarks show they both provide a
> speed boost separately, and more so when combined.

If tcache was deeper, even if only for smaller sizes, it would make fastbins
completely redundant and with it all the complex consolidation. As a result,
there would be less fragmentation since adjacent free blocks will be merged
together more often.

>> Modern allocators are not only much faster than GLIBC in their default
>> settings
>
> Back this up with data please.  Tcache invalidated most online
> benchmarks.

Here is a recent paper that covers GLIBC with tcache - it still loses both on
performance and memory usage: https://arxiv.org/pdf/1905.01135.pdf 

>> but also have lower memory usage.
>
> This is a project we've got on our to-do list.

I don't believe you can fix that without a major rewrite.

Cheers,
Wilco

  reply	other threads:[~2022-12-15 15:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 16:09 Wilco Dijkstra
2022-11-21 16:18 ` Florian Weimer
2022-11-21 16:55   ` Wilco Dijkstra
2022-11-21 16:56     ` Wilco Dijkstra
2022-11-21 17:00     ` Florian Weimer
2022-12-02  5:11 ` DJ Delorie
2022-12-02  6:36   ` Florian Weimer
2022-12-02 10:56     ` Wilco Dijkstra
2022-12-02 11:24       ` Florian Weimer
2022-12-02 12:02         ` Wilco Dijkstra
2022-12-02 18:55           ` DJ Delorie
2022-12-05 18:39             ` Zack Weinberg
2022-12-06 16:19               ` DJ Delorie
2022-12-12  3:35                 ` Zack Weinberg
2022-12-12 11:57                   ` Florian Weimer
2022-12-12 11:56                 ` Florian Weimer
2022-12-06 13:29             ` Wilco Dijkstra
2022-12-06 13:37               ` Adhemerval Zanella Netto
2022-12-06 14:31                 ` Zack Weinberg
2022-12-06 16:23               ` DJ Delorie
2022-12-15 15:43                 ` Wilco Dijkstra [this message]
2022-12-02 18:55     ` DJ Delorie
2022-12-06 15:04 Wilco Dijkstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PAWPR08MB8982FFE53EF1BE027040839883E19@PAWPR08MB8982.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).