Re: strlcpy version speed tests?

2020-07-04 Thread Stuart Longland
On 1/7/20 10:05 pm, Luke Small wrote: > Are you clinging to traditions for some purpose? Are you posting random pieces of code and asking for critique on them for no apparent reason for some purpose? To be clear, this was the sum and total of your first message in this thread (excluding

Re: strlcpy version speed tests?

2020-07-04 Thread Otto Moerbeek
On Sat, Jul 04, 2020 at 09:07:35AM -0400, Brian Brombacher wrote: > > >> On Jul 1, 2020, at 1:14 PM, gwes wrote: > >> > >> On 7/1/20 8:05 AM, Luke Small wrote: > >> I spoke to my favorite university computer science professor who said > >> ++n is faster than n++ because the function needs to

Re: strlcpy version speed tests?

2020-07-04 Thread Brian Brombacher
>> On Jul 1, 2020, at 1:14 PM, gwes wrote: >> >> On 7/1/20 8:05 AM, Luke Small wrote: >> I spoke to my favorite university computer science professor who said >> ++n is faster than n++ because the function needs to store the initial >> value, increment, then return the stored value in the

Re: strlcpy version speed tests?

2020-07-01 Thread gwes
On 7/1/20 8:05 AM, Luke Small wrote: I spoke to my favorite university computer science professor who said ++n is faster than n++ because the function needs to store the initial value, increment, then return the stored value in the former case, while the later merely increments, and returns the

Re: strlcpy version speed tests?

2020-07-01 Thread Marc Espie
On Wed, Jul 01, 2020 at 07:05:02AM -0500, Luke Small wrote: > Are you clinging to traditions for some purpose? I gave two different > versions. strlcpy3 is clearly more easily understood and even slightly > faster and strlcpy4 which sets up the following workhorse lines which > through timing the

Re: strlcpy version speed tests?

2020-07-01 Thread Luke Small
Are you clinging to traditions for some purpose? I gave two different versions. strlcpy3 is clearly more easily understood and even slightly faster and strlcpy4 which sets up the following workhorse lines which through timing the functions is hands down faster on my Xeon chips: strlcpy4: while

Re: strlcpy version speed tests?

2020-06-30 Thread Luke Small
I suppose this strlcpy4 without a goto is more elegant -Luke On Tue, Jun 30, 2020 at 10:07 PM Luke Small wrote: > I made it SUPER easy to test my assertion. The code is there. No > configuration needed. > > On Tue, Jun 30, 2020 at 9:59 PM Theo de Raadt wrote: > >> Luke Small wrote: >> >> >

Re: strlcpy version speed tests?

2020-06-30 Thread Stuart Longland
On 1/7/20 11:18 am, Luke Small wrote: > I made a couple different versions if anybody is interested! You don't need our permission… -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere.

strlcpy version speed tests?

2020-06-30 Thread Luke Small
I made a couple different versions if anybody is interested! -Luke #include #include #include #include #include #include /* cc strlcpy_test.c -pipe -O2 -o strlcpy_test && ./strlcpy_testfast */ /* * Copy string src to buffer dst of size dsize. At most dsize-1 * chars will be copied.