[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1551917 - /subversion/trunk/subversion/svnserve/logger.c

From: Stefan Sperling <stsp_at_apache.org>
Date: Thu, 19 Dec 2013 01:18:34 +0100

On Wed, Dec 18, 2013 at 10:22:26PM +0100, Bert Huijben wrote:
> Can you explain why you changed this?
>
> This changes one bit of dynamic calculation to another bit of dynamic calculation while this string is completely constant. You now use the compiler to optimize away a strlen, but apr_snprintf() has a lot more overhead in other places (variable arguments, parsing the format string, etc.).
>
> In this case I'm really wondering why we change working code...?
>
> Bert
>

I just think we shouldn't use strcpy() anywhere. It's always a
red flag for me when reading code. In this case it does no harm,
of course, but I still think code using strcpy() is generally
bad style. The function should be phased out of general use.

Feel free to revert this if the alleged performance overhead
in the logging subsystem of svnserve concerns you more than my
peace of mind that we don't use strcpy() in our core code (all
other instances I found where in tests or generated bindings code
where I don't care as much but wouldn't mind seeing them eradicated
either).
Received on 2013-12-19 01:20:27 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.