From patchwork Thu Mar 2 19:05:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 65926 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6560B3857803 for ; Thu, 2 Mar 2023 19:05:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6560B3857803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677783934; bh=SAjAX4iFIwEkb8F4sCNsufv04V3PQR1jHFFxq9/8cJY=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=Qt1gkdc4SAUyJT+MozVbyiH5u1VAfPcgbhOwsjzkdlV4kQOUTAhixd7etJ0AoU/2G +7u+NuAkKUzWSXhxyYvLPnJRivzOhZLz2D9a5Tze4pQ/HybxmaAHezzL/9m6UymuS9 I1SWPVBu1ncohaYlj9yZBpi5l1BLP4iP3ZhOj0Mg= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2A105385B513 for ; Thu, 2 Mar 2023 19:05:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A105385B513 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-647-ezt5BVTZM8asuJEjfJjW3Q-1; Thu, 02 Mar 2023 14:05:26 -0500 X-MC-Unique: ezt5BVTZM8asuJEjfJjW3Q-1 Received: by mail-qt1-f200.google.com with SMTP id w16-20020ac843d0000000b003bfe50a4105so149161qtn.10 for ; Thu, 02 Mar 2023 11:05:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677783926; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SAjAX4iFIwEkb8F4sCNsufv04V3PQR1jHFFxq9/8cJY=; b=4d27jxvwrpxyMGDhTxm/l4H+QK6CVxB25TzyGrgidHCxfegG/L5XO5eR1bnLvJW8mE Aync/nfMZ6U7O2RyMa9UcRNXP5Wd+1Z+94kSzjkkPfLYpAJqblq8DDhMCMRjDv1Kki2X Ub+KBwdl6VDuh9dQZb6M2er/ojv/ClX6BN3q7PZjUD2nDEVXTwzZjMa5AU7QeYstzNly agCVjiVnu5x+wbH2s/ubQBZA06R07cUWetPQDfIzDLwrlXty97IYTXKrl4N24ji8s4Lo pNd5+kQcpr+1DTRlZPXirf9LqhXeCcJGXZcIo2wF56C5lKAbEAAot36UOktJ9vwA5CVJ /7Og== X-Gm-Message-State: AO0yUKX9A7wGGWlaGwy8KdYNpiitCkHSrjK8Khtnm1HjfCPtu9zsvwE2 yk5LVyadMMV6h+7TnfW1beHX7JyYPVHjCWVH1ns43Qt5HeyM13eajEw9gDZHyQYXZHOZqJx/dqh SVVwi4aVvEUy0a6eUecCXUUfo9w== X-Received: by 2002:a05:6214:124f:b0:56e:c238:b719 with SMTP id r15-20020a056214124f00b0056ec238b719mr22608158qvv.2.1677783925998; Thu, 02 Mar 2023 11:05:25 -0800 (PST) X-Google-Smtp-Source: AK7set9mMwWcqPcd2qx3+w3ctdVnzQ0EL9Y2v76WDWHzSOh0mtZSFYYC4CK6L7cZH0B0+zosAc3Uzg== X-Received: by 2002:a05:6214:124f:b0:56e:c238:b719 with SMTP id r15-20020a056214124f00b0056ec238b719mr22608114qvv.2.1677783925632; Thu, 02 Mar 2023 11:05:25 -0800 (PST) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id z75-20020a37654e000000b007423c011937sm176330qkb.91.2023.03.02.11.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 11:05:24 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 7ECD0581C79; Thu, 2 Mar 2023 20:05:23 +0100 (CET) To: Dodji Seketeli Cc: libabigail@sourceware.org, ckalina@redhat.com Subject: [PATCH 13/13] comp-filter: Speed up harmless/harmful categorization Organization: Red Hat / France References: <877cvzrnws.fsf@redhat.com> <87356nrnmq.fsf@redhat.com> X-Operating-System: Fedora 38 X-URL: http://www.redhat.com Date: Thu, 02 Mar 2023 20:05:23 +0100 In-Reply-To: <87356nrnmq.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 02 Mar 2023 19:53:17 +0100") Message-ID: <87cz5rotxo.fsf_-_@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, Categorizing a diff graph with a thousands of function diff nodes takes a lot of time. At that point, categorizing each node has harmful/harmless is showing up in the profile, particularly because has_var_type_cv_qual_change and to a lesser extend class_diff_has_harmless_odr_violation_change perform some structural comparison still, oops. This patch avoids doing that. On my machine, the categorizing of each node goes from around 130ms to 92 ms. * src/abg-comp-filter.cc (class_diff_has_harmless_odr_violation_change) (has_var_type_cv_qual_change): Avoid doing structural comparison here. Signed-off-by: Dodji Seketeli --- src/abg-comp-filter.cc | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index 5300d07c..f1d67de5 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -775,14 +775,10 @@ class_diff_has_harmless_odr_violation_change(const diff* dif) class_decl_sptr first = d->first_class_decl(); class_decl_sptr second = d->second_class_decl(); - if (equals(*first, *second, 0)) - { - class_decl_sptr fc = is_class_type(first->get_canonical_type()); - class_decl_sptr sc = is_class_type(second->get_canonical_type()); - - if (!equals(*fc, *sc, 0)) - return true; - } + if (first->get_qualified_name() == second->get_qualified_name() + && first != second + && first->get_corpus() == second->get_corpus()) + return true; return false; } @@ -1643,18 +1639,9 @@ has_var_type_cv_qual_change(const diff* dif) if (!var_dif) return false; - { - // Make sure the variable diff does carry a type change at least - change_kind ch_kind = NO_CHANGE_KIND; - if (equals(*var_dif->first_var(), *var_dif->second_var(), &ch_kind)) - return false; - - if (!(ch_kind & LOCAL_TYPE_CHANGE_KIND || ch_kind & SUBTYPE_CHANGE_KIND)) - return false; - } - diff *type_dif = var_dif->type_diff().get(); - ABG_ASSERT(type_dif); + if (!type_dif) + return false; return type_diff_has_cv_qual_change_only(type_dif); }