Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-31 Thread Ken Matsui via Gcc-patches
On Thu, Aug 31, 2023 at 6:57 AM Ken Matsui wrote: > > On Tue, Aug 8, 2023 at 1:19 PM Jonathan Wakely wrote: > > > > > > > > On Tue, 18 Jul 2023 at 07:25, Ken Matsui via Libstdc++ > > wrote: > >> > >> Hi, > >> > >> I took a benchmark for this. > >> > >>

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-31 Thread Ken Matsui via Gcc-patches
On Tue, Aug 8, 2023 at 1:19 PM Jonathan Wakely wrote: > > > > On Tue, 18 Jul 2023 at 07:25, Ken Matsui via Libstdc++ > wrote: >> >> Hi, >> >> I took a benchmark for this. >> >> https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 >> >>

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-31 Thread Ken Matsui via Gcc-patches
On Tue, Aug 8, 2023 at 1:14 PM Jonathan Wakely wrote: > > > > On Tue, 18 Jul 2023 at 07:28, Ken Matsui via Libstdc++ > wrote: >> >> I will eventually work on disjunction to somehow optimize, but in the >> meantime, this might be a better implementation. Of course, my >> benchmark could be

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:25, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Hi, > > I took a benchmark for this. > > > https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 > > template > struct is_fundamental > : public

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:28, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > I will eventually work on disjunction to somehow optimize, but in the > meantime, this might be a better implementation. Of course, my > benchmark could be wrong. > You should use __or_ internally in

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-22 Thread François Dumont via Gcc-patches
It seems rather logical cause std::disjunction is supposed to avoid instantiations but in case of: std::disjunction, std::is_null_pointer<_Tp>> you'll avoid std::is_null_pointer instantiation only for 'void' type and at the price of instantiating std::disjunction so 2 instantiations at best

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-18 Thread Ken Matsui via Gcc-patches
I will eventually work on disjunction to somehow optimize, but in the meantime, this might be a better implementation. Of course, my benchmark could be wrong. On Mon, Jul 17, 2023 at 11:24 PM Ken Matsui wrote: > > Hi, > > I took a benchmark for this. > >

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-18 Thread Ken Matsui via Gcc-patches
Hi, I took a benchmark for this. https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 template struct is_fundamental : public std::bool_constant<__is_arithmetic(_Tp) || std::is_void<_Tp>::value

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-16 Thread Ken Matsui via Gcc-patches
On Sun, Jul 16, 2023 at 5:41 AM François Dumont wrote: > > > On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: > > This patch optimizes the performance of the is_fundamental trait by > > dispatching to the new __is_arithmetic built-in trait. > > > > libstdc++-v3/ChangeLog: > > > > *

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-16 Thread François Dumont via Gcc-patches
On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-14 Thread Ken Matsui via Gcc-patches
Hi, Here are the benchmarks for this change: * is_fundamental https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental.md#fri-jul-14-091146-pm-pdt-2023 Time: -37.1619% Peak Memory Usage: -29.4294% Total Memory Usage: -29.4783% * is_fundamental_v

[PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the