public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: fweimer@redhat.com, libc-alpha@sourceware.org
Subject: Re: [PATCH v3 1/1] memalign: Support scanning for aligned chunks.
Date: Fri, 22 Jul 2022 16:21:58 -0400	[thread overview]
Message-ID: <xnsfmsaoex.fsf@greed.delorie.com> (raw)
In-Reply-To: <xnilnsbp3e.fsf@greed.delorie.com>


Sidebar - I ran the malloc benchtests on before/after builds, and the
variation between the two seemed no more or less than the variation
between just running the "before" tests twice.

The variation, just running the same tests multiple times, seems larger
than the gains/losses we typically get with malloc tweaks, though.
Computers are just too fast and unpredictable these days ;-)

I also have a python script that compares malloc benchtest runs (below).
Run like this:

 $ compare-malloc.py ~/tools/upstream/glibc.pristine.build/benchtests ~/tools/upstream/glibc.memalign.build/benchtests `ls -1d bench-malloc-simple-*.out | nsort` > /tmp/malloc2.csv

If there's interest, I can add this to benchtests/scripts

---------- 8< ----------
#!/usr/bin/python

import sys
import json
import argparse
import pprint
    
def do_keys (pattern, bd, ad):
    avg = 0
    count = 0
    print_it = 0;
    for b in sorted(bd.keys()):
        if pattern in b:
            if print_it:
                print ("%s,%s,%s,%s" % (save_b, bv, av, imp));
            save_b = b;
            bv = bd[b]
            av = ad[b]
            imp = av / bv;
            avg += imp
            count = count + 1
            print_it = 1

    if print_it:
        print ("%s,%s,%s,%s,%s" % (save_b, bv, av, imp, avg/count));

def compare_files(fn1, fn2, t):
    b = open (fn1, 'r')
    before = json.load(b)
    a = open (fn2, 'r')
    after = json.load(a)

    print (t)
    print ("Test,Before,After,Ratio,Average")
    do_keys ('max_rss', before['functions']['malloc'][''], after['functions']['malloc'][''])
    do_keys ('main_arena', before['functions']['malloc'][''], after['functions']['malloc'][''])
    do_keys ('thread_arena', before['functions']['malloc'][''], after['functions']['malloc'][''])
    print ("");

def main(argv):
    before_dir = argv[1];
    after_dir = argv[2];
    files = argv[3:]

    for f in files:
        bf = before_dir + "/" + f;
        af = after_dir + "/" + f;
        compare_files (bf, af, f)

if __name__ == '__main__':
    main(sys.argv)


  reply	other threads:[~2022-07-22 20:22 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14  3:58 [PATCH v1 " DJ Delorie
2022-07-19  2:54 ` Carlos O'Donell
2022-07-19  3:57   ` [PATCH v2 " DJ Delorie
2022-07-19  9:19     ` Florian Weimer
2022-07-19 17:32       ` DJ Delorie
2022-07-20  0:32       ` [PATCH v3 " DJ Delorie
2022-07-22 20:21         ` DJ Delorie [this message]
2022-07-22 20:28         ` Joseph Myers
2022-07-28 19:50           ` [PATCH v4 " DJ Delorie
2022-08-17 19:00             ` DJ Delorie
2022-11-10 21:40               ` Ping^2: " DJ Delorie
2023-03-20 21:49                 ` Ping^3: " DJ Delorie
2023-03-28 19:07             ` Adhemerval Zanella Netto
2023-03-29  4:20               ` [PATCH v5 " DJ Delorie
2023-03-29 19:41                 ` Adhemerval Zanella Netto
2023-03-29 20:36                   ` DJ Delorie
2023-03-30 10:04                     ` Cristian Rodríguez
2023-03-30 10:50                       ` Adhemerval Zanella Netto
2023-03-30 21:43                         ` Cristian Rodríguez
2023-04-12 17:04                           ` Xi Ruoyao
2023-04-12 17:16                             ` DJ Delorie
2023-04-12 17:26                               ` Xi Ruoyao
2023-04-13  1:52                                 ` [PATCH v6 " DJ Delorie
2023-04-13  5:51                                   ` Xi Ruoyao
2023-04-17 21:48                                   ` Carlos O'Donell
2023-04-18  1:25                                     ` [PATCH v7] " DJ Delorie
2023-04-18 13:58                                       ` Carlos O'Donell
2023-04-18 15:02                                         ` DJ Delorie
2023-04-12 17:33                             ` [PATCH v5 1/1] " Adhemerval Zanella Netto
2023-04-12 17:40                               ` DJ Delorie
2023-04-12 18:01                                 ` Adhemerval Zanella Netto
2023-04-13  1:57                                   ` DJ Delorie
2023-04-13 10:46                                     ` Adhemerval Zanella Netto
2023-04-05 14:07                     ` Stefan Liebler
2023-04-05 17:58                       ` DJ Delorie
2023-04-11 11:40                         ` Stefan Liebler
2023-04-12 11:23                           ` Stefan Liebler
2023-03-31 15:39                 ` Adhemerval Zanella Netto

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=xnsfmsaoex.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=fweimer@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).