lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What tests are run by patchy?


From: Frédéric Bron
Subject: Re: What tests are run by patchy?
Date: Fri, 23 Aug 2013 14:15:21 +0200

> Have you double-checked the code g++ generates?  I should not be overly
> surprised if current versions don't actually do much copying unless
> required.

I know what you mean: "premature optimization is the root of all
evil". But here, it is just following standard practice as recommended
by all textbooks.

The standard <string> library can implement copy on write but it is
not mandatory and we should not rely on that behaviour. Also the
compiler may do some optimizations and remove some copies him-self but
should we rely on a particular compiler to do our job when it is so
"easy" to write efficient code?
When I have finished, I plan to do a time comparison on some scores I
have. The locations where strings are copied are really numerous and I
am not planning to remove all of them: I am not checking if we really
need 'string' as return type instead of 'const string&'. This could be
another patch...

Frédéric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]