On Fri, Jul 14, 2023 at 3:49 AM Jonathan Wakely <jwak...@redhat.com> wrote:
>
> On Fri, 14 Jul 2023 at 11:48, Jonathan Wakely <jwak...@redhat.com> wrote:
> >
> > On Thu, 13 Jul 2023 at 21:04, Ken Matsui <kmat...@cs.washington.edu> wrote:
> > >
> > > On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely <jwak...@redhat.com> 
> > > wrote:
> > > >
> > > > On Wed, 12 Jul 2023 at 21:42, Ken Matsui <kmat...@cs.washington.edu> 
> > > > wrote:
> > > > >
> > > > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely <jwak...@redhat.com> 
> > > > > wrote:
> > > > > >
> > > > > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++
> > > > > > <libstd...@gcc.gnu.org> wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Here is the benchmark result for is_pointer:
> > > > > > >
> > > > > > > https://github.com/ken-matsui/gcc-benches/blob/main/is_pointer.md#sun-jul--9-103948-pm-pdt-2023
> > > > > > >
> > > > > > > Time: -62.1344%
> > > > > > > Peak Memory Usage: -52.4281%
> > > > > > > Total Memory Usage: -53.5889%
> > > > > >
> > > > > > Wow!
> > > > > >
> > > > > > Although maybe we could have improved our std::is_pointer_v anyway, 
> > > > > > like so:
> > > > > >
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v = false;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp*> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* const> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* volatile> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* const volatile> = true;
> > > > > >
> > > > > > I'm not sure why I didn't already do that.
> > > > > >
> > > > > > Could you please benchmark that? And if it is better than the 
> > > > > > current
> > > > > > impl using is_pointer<_Tp>::value then we should do this in the
> > > > > > library:
> > > > > >
> > > > > > #if __has_builtin(__is_pointer)
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v = __is_pointer(_Tp);
> > > > > > #else
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v = false;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp*> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* const> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* volatile> = true;
> > > > > > template <typename _Tp>
> > > > > >   inline constexpr bool is_pointer_v<_Tp* const volatile> = true;
> > > > > > #endif
> > > > >
> > > > > Hi François and Jonathan,
> > > > >
> > > > > Thank you for your reviews! I will rename the four underscores to the
> > > > > appropriate name and take a benchmark once I get home.
> > > > >
> > > > > If I apply your change on is_pointer_v, is it better to add the
> > > > > `Co-authored-by:` line in the commit?
> > > >
> > > > Yes, that would be the correct thing to do (although in this case the
> > > > change is small enough that I don't really care about getting credit
> > > > for it :-)
> > > >
> > > Thank you! I will include it in my commit :) I see that you included
> > > the DCO sign-off in the MAINTAINERS file. However, if a reviewer
> > > doesn't, should I include the `Signed-off-by:` line for the reviewer
> > > as well?
> >
> > No, reviewers should not sign-off, that's for the code author. And
> > authors should add that themselves (or clearly state that they agree
> > to the DCO terms). You should not sign-off on someone else's behalf.
>
> You can add Reviewed-by: if you want to record that information.
>
I see. Thank you!

Reply via email to