From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 313D83857424 for ; Fri, 16 Jul 2021 09:49:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 313D83857424 Received: by mail-ej1-x634.google.com with SMTP id hd33so14223197ejc.9 for ; Fri, 16 Jul 2021 02:49:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qix3GfH9JZG+HQsOfFL+PfAUBKuHda7epMkHfnUydMc=; b=qOAcomKVGfyK+jg2SL/kCWb+jBnCXYrnK01IDI1hsxwuegbIHmqj982orJsIFU5cxO crpCQ0Nm2jVaLvOuyg0YiOBfJJRC1vqo1XBeZWFnwNDYkRpg0iXieRtjTsaD0frRRsIJ Jr3caG731M5zqP95q7WRoOLuMBxH7J2MVauxHlPQcn6BwMOBqXD65YWhOsaA/N4xQ4KB WuB6+GzzXyLD05BtSaMTfqh85IHu9ZavYZLKQ4MbUemoosldAul7g3+BG8ARbs46JQNR IuYgLb9DAlmZTtR+GIDJ+X2Qy3UvKn29AyePTYM9c9rNJJeAfRoTMAeNcnFhs37hCBst lmXA== X-Gm-Message-State: AOAM530/EX3mtap4pRtrNzh2PNIMnHEIfr+HEnQ2jQxWXY0Je3v8O2qO L5bte6CP7fy4B112id5WmPxqrncwHkoBsnTxRU3kow== X-Google-Smtp-Source: ABdhPJxWz3wQFtv6eMW8COTLv7NHzXS4nNQ8fw6l8Ar3DlGM7ejvadubW6sgfotDZ13F0CaRjswpqhJ7BN2YtyaDLWg= X-Received: by 2002:a17:906:6c91:: with SMTP id s17mr10573974ejr.403.1626428946898; Fri, 16 Jul 2021 02:49:06 -0700 (PDT) MIME-Version: 1.0 References: <20210705094529.2485114-1-maennich@google.com> <87zgumei54.fsf@seketeli.org> In-Reply-To: <87zgumei54.fsf@seketeli.org> From: =?UTF-8?Q?Matthias_M=C3=A4nnich?= Date: Fri, 16 Jul 2021 10:48:50 +0100 Message-ID: Subject: Re: [PATCH, applied] Consistently use std::unique_ptr for private implementations (pimpl) To: Dodji Seketeli Cc: Giuliano Procida , Android Kernel Team , Giuliano Procida via Libabigail Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-22.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 16 Jul 2021 09:49:09 -0000 On Fri, Jul 16, 2021 at 10:13 AM Dodji Seketeli wrote: > > Hello, > > Matthias Maennich a =C3=A9crit: > > > In the absence of non-refcounting smart pointers before C++11, > > std::shared_ptr was commonly used instead. Having bumped the standard t= o > > C++11, allows us to use std::unique_ptr consistently avoiding any costs > > involved with shared_ptr ref counting. Hence do that and add default > > virtual destructors where required. > > Thanks for doing this! > > So, after testing on an old AMD machine, here is the difference in the > time taken (as reported by the 'time' command) by "make check" between > the master branch without the patch, and with the patch. > > Without the patch: > > real 3m41,260s > user 10m44,672s > sys 1m27,097s > > With the patch: > > real 2m7,102s > user 11m48,024s > sys 1m18,589s > > Pretty neat isn't it? :-) Oh wow! That is indeed neat! Guiliano was benchmarking the change and came to an improvement there as well. The effect was not as strong, though: abidw: 1:43 or 1:47 abidiff: 1:31 after: abidw: 1:42 or 1:45 abidiff: 1:30 Cheers, Matthias > > So thanks a lot for that! > > > > > * include/abg-comparison.h (diff_maps): use unique_ptr for priv_ > > (diff_context): Likewise. > > (diff_traversable_base): Likewise. > > (type_diff_base): Likewise. > > (decl_diff_base): Likewise. > > (distinct_diff): Likewise. > > (var_diff): Likewise. > > (pointer_diff): Likewise. > > (reference_diff): Likewise. > > (array_diff): Likewise. > > (qualified_type_diff): Likewise. > > (enum_diff): Likewise. > > (class_or_union_diff): Likewise. > > (class_diff): Likewise. > > (base_diff): Likewise. > > (scope_diff): Likewise. > > (fn_parm_diff): Likewise. > > (function_type_diff): Likewise. > > (function_decl_diff): Likewise. > > (typedef_diff): Likewise. > > (translation_unit_diff): Likewise. > > (diff_stats): Likewise. > > (diff_node_visitor): Likewise. > > * include/abg-corpus.h (corpus): Likewise. > > (exported_decls_builder): Likewise. > > (corpus_group): Likewise. > > * include/abg-ini.h (property): Likewise. > > (property_value): Likewise. > > (string_property_value): Likewise. > > (list_property_value): Likewise. > > (tuple_property_value): Likewise. > > (simple_property): Likewise. > > (list_property): Likewise. > > (tuple_property): Likewise. > > (config): Likewise. > > (section): Likewise. > > (function_call_expr): Likewise. > > * include/abg-interned-str.h (interned_string_pool): Likewise. > > * include/abg-ir.h (environment): Likewise. > > (location_manager): Likewise. > > (type_maps): Likewise. > > (translation_unit): Likewise. > > (elf_symbol::version): Likewise. > > (type_or_decl_base): Likewise. > > (scope_decl): Likewise. > > (qualified_type_def): Likewise. > > (pointer_type_def): Likewise. > > (array_type_def): Likewise. > > (subrange_type): Likewise. > > (enum_type_decl): Likewise. > > (enum_type_decl::enumerator): Likewise. > > (typedef_decl): Likewise. > > (dm_context_rel): Likewise. > > (var_decl): Likewise. > > (function_decl::parameter): Likewise. > > (function_type): Likewise. > > (method_type): Likewise. > > (template_decl): Likewise. > > (template_parameter): Likewise. > > (type_tparameter): Likewise. > > (non_type_tparameter): Likewise. > > (template_tparameter): Likewise. > > (type_composition): Likewise. > > (function_tdecl): Likewise. > > (class_tdecl): Likewise. > > (class_decl::base_spec): Likewise. > > (ir_node_visitor): Likewise. > > * include/abg-suppression.h (suppression_base): Likewise. > > (type_suppression::insertion_range): Likewise. > > (type_suppression::insertion_range::boundary): Likewise. > > (type_suppression::insertion_range::integer_boundary): Likewise. > > (type_suppression::insertion_range::fn_call_expr_boundary): Likew= ise. > > (function_suppression): Likewise. > > (function_suppression::parameter_spec): Likewise. > > (file_suppression): Likewise. > > * include/abg-tools-utils.h (temp_file): Likewise. > > (timer): Likewise. > > * include/abg-traverse.h (traversable_base): Likewise. > > * include/abg-workers.h (queue): Likewise. > > * src/abg-comparison.cc (diff_context): add default destructor. > > (diff_maps): Likewise. > > (corpus_diff): Likewise. > > (diff_node_visitor): Likewise. > > (class_or_union_diff::get_priv): adjust return type. > > (class_diff::get_priv): adjust return type. > > * src/abg-corpus.cc (corpus): add default destructor. > > * src/abg-ir.cc (location_manager): Likewise. > > (type_maps): Likewise. > > (elf_symbol::version): Likewise. > > (array_type_def::subrange_type): Likewise. > > (enum_type_decl::enumerator): Likewise. > > (function_decl::parameter): Likewise. > > (class_decl::base_spec): Likewise. > > (ir_node_visitor): Likewise. > > > > Signed-off-by: Matthias Maennich > > Applied to master. Thanks! > > [...] > > Cheers, > > -- > Dodji