[PATCH 0/2] Optimize is_member_pointer trait performance

Ken Matsui kmatsui@gcc.gnu.org
Tue Sep 12 04:26:17 GMT 2023


This patch series optimizes is_member_pointer trait
performance. The first patch implements __is_member_pointer
built-in trait. The second patch optimizes is_member_pointer
trait performance by using __is_member_pointer built-in trait
if available.

The performance improvement is shown in the following benchmark:

https://github.com/ken-matsui/gsoc23/blob/main/is_member_pointer_v.md#mon-sep-11-092927-pm-pdt-2023

Time: -47.2037% +/- 2.12936%
Peak Memory Usage: -39.4183% +/- 0.00217276%
Total Memory Usage: -41.9905% +/- 0%

Ken Matsui (2):
  c++: Implement __is_member_pointer built-in trait
  libstdc++: Optimize is_member_pointer trait performance

 gcc/cp/constraint.cc                         |  3 ++
 gcc/cp/cp-trait.def                          |  1 +
 gcc/cp/semantics.cc                          |  4 +++
 gcc/testsuite/g++.dg/ext/has-builtin-1.C     |  3 ++
 gcc/testsuite/g++.dg/ext/is_member_pointer.C | 30 ++++++++++++++++++++
 libstdc++-v3/include/std/type_traits         | 16 ++++++++++-
 6 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/ext/is_member_pointer.C

-- 
2.42.0



More information about the Gcc-patches mailing list