From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A806E3858405 for ; Fri, 22 Jul 2022 20:22:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A806E3858405 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622--d_BXc-5MEqAOEsXH0fAvw-1; Fri, 22 Jul 2022 16:21:59 -0400 X-MC-Unique: -d_BXc-5MEqAOEsXH0fAvw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 02490101A58D for ; Fri, 22 Jul 2022 20:21:59 +0000 (UTC) Received: from greed.delorie.com (unknown [10.22.8.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2F3A141511A; Fri, 22 Jul 2022 20:21:58 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 26MKLwb8517340; Fri, 22 Jul 2022 16:21:58 -0400 From: DJ Delorie To: fweimer@redhat.com, libc-alpha@sourceware.org Subject: Re: [PATCH v3 1/1] memalign: Support scanning for aligned chunks. In-Reply-To: Date: Fri, 22 Jul 2022 16:21:58 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 20:22:07 -0000 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)