From patchwork Tue Mar 6 13:41:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 882070 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90845-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="IunK1GGb"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zwdHW3XS6z9shN for ; Wed, 7 Mar 2018 00:42:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=VunlI+bchjo95+4nfN2nf+B1xYUfD7o /NVjXhwaw+IItJ+j7Heiz1Rh72xlG5SfuTtvDcp+927r2l/h4qtOoFcMrHY52Ung lLii9ksTxmAryro1P93NdwleehwzSOmY5vrFeh/FuDjp6wg5aaz95ID5IM/kyhJx o6O95pHBbmZM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=e/QhrvZtzcpnC/SrmqwaNUHwvr0=; b=IunK1 GGbUZNA1sk0HnQIyZ4t25u7J12yKW44f1TTp9J++j3SRa18YdpJqvfMsSZWJUDoA fUwHnVA06cmOK899OtRDyWKzYp3JsjvbiIZG+8YqnkkAJrz4++I7tpmMRpX2xDmy T5ySXNpXSGDlc6iWw8iQTapooeWMb4WidaDsrM= Received: (qmail 51038 invoked by alias); 6 Mar 2018 13:41:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 50951 invoked by uid 89); 6 Mar 2018 13:41:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: homiemail-a56.g.dreamhost.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [COMMITTED 3/3] benchtests: Don't benchmark 0 length calls for strncmp Date: Tue, 6 Mar 2018 19:11:38 +0530 Message-Id: <20180306134138.27724-3-siddhesh@sourceware.org> In-Reply-To: <20180306134138.27724-1-siddhesh@sourceware.org> References: <20180306134138.27724-1-siddhesh@sourceware.org> The 0 length strncmp is interesting for correctness but not for performance. * benchtests/bench-strncmp.c (test_main): Remove 0 length tests. (do_test_limit): Likewise. --- benchtests/bench-strncmp.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/benchtests/bench-strncmp.c b/benchtests/bench-strncmp.c index 4354d708fb..97dc39069d 100644 --- a/benchtests/bench-strncmp.c +++ b/benchtests/bench-strncmp.c @@ -137,29 +137,6 @@ do_test_limit (json_ctx_t *json_ctx, size_t align1, size_t align2, size_t len, size_t i, align_n; CHAR *s1, *s2; - if (n == 0) - { - json_element_object_begin (json_ctx); - json_attr_uint (json_ctx, "strlen", (double) len); - json_attr_uint (json_ctx, "len", (double) n); - json_attr_uint (json_ctx, "align1", (double) 0); - json_attr_uint (json_ctx, "align2", (double) 0); - json_array_begin (json_ctx, "timings"); - - FOR_EACH_IMPL (impl, 0) - { - realloc_bufs (); - s1 = (CHAR *) (buf1 + page_size); - s2 = (CHAR *) (buf2 + page_size); - do_one_test (json_ctx, impl, s1, s2, n, 0); - } - - json_array_end (json_ctx); - json_element_object_end (json_ctx); - - return; - } - align1 &= 15; align2 &= 15; align_n = (page_size - n * CHARBYTES) & 15; @@ -315,7 +292,6 @@ test_main (void) do_test (&json_ctx, 2 * i, i, 8 << i, 16 << i, 255, 1); } - do_test_limit (&json_ctx, 0, 0, 0, 0, 127, 0); do_test_limit (&json_ctx, 4, 0, 21, 20, 127, 0); do_test_limit (&json_ctx, 0, 4, 21, 20, 127, 0); do_test_limit (&json_ctx, 8, 0, 25, 24, 127, 0);