[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] valyuta/005 4483b09 1/9: Avoid passing 'currency
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [lmi-commits] valyuta/005 4483b09 1/9: Avoid passing 'currency' by const reference |
Date: |
Wed, 20 Jan 2021 18:09:34 +0100 |
On Wed, 20 Jan 2021 00:51:31 -0500 (EST) Greg Chicares
<gchicares@sbcglobal.net> wrote:
GC> branch: valyuta/005
GC> commit 4483b09a9bf445c58b1be677221a72fbde4de13f
GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
GC>
GC> Avoid passing 'currency' by const reference
GC>
GC> See:
GC> https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in
GC> sizeof(currency) equals sizeof(double), so pass by value.
GC>
GC> This change would appear to make both 32- and 64-bit msw builds slightly
GC> slower, so is the guideline appropriate for currency operators?
This is very, very astonishing. Are the benchmark results reproducible for
you?
I'd expect gcc to optimize away the references anyhow with any -O options,
so I'm surprised that the results are not exactly the same, but I just
can't explain how could they differ in this direction. I may look at the
generated assembly, if you'd like, because this is just too strange.
Regards,
VZ
pgpo8QysfA0WT.pgp
Description: PGP signature
- Re: [lmi] [lmi-commits] valyuta/005 4483b09 1/9: Avoid passing 'currency' by const reference,
Vadim Zeitlin <=