Joerg Jung wrote:
> 
> 
> > Am 28.10.2015 um 17:05 schrieb Michael McConville <[email protected]>:
> > 
> > Relayd, httpd, and ntpd define the functions get_data() and
> > get_string(). Both call calloc and then immediately memcpy. Calloc's
> > zeroing isn't optimized out. These functions are called in network data
> > paths in at least a couple places, so all this extra writing could have
> > a meaningful performance impact.
> 
> I think this impact is negligible small and I believe
> that you can not even measure it.
> So this change makes not so much sense to me.

I think there's no reason to be inefficient if the faster way of doing things
is just as simple and correct.

> I wonder if using strndup() would make more 
> sense for the first case here?

Agreed on that point.

Reply via email to