Re: [PATCH] performance improvement for apr_pstrcat

2001-09-28 Thread Ian Holsman
Cliff Woolley wrote: On Wed, 26 Sep 2001, Brian Pane wrote: apr_pstrcat does two passes through its args: one to compute the length, a second to do the copying. This patch adds a buffer to save the lengths of the first 6 args so that the second pass doesn't need to another strlen on them.

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Cliff Woolley
On Wed, 26 Sep 2001, Brian Pane wrote: > apr_pstrcat does two passes through its args: one to compute the > length, a second to do the copying. This patch adds a buffer to > save the lengths of the first 6 args so that the second pass > doesn't need to another strlen on them.

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
Ryan Bloom wrote: On Wednesday 26 September 2001 06:57 pm, Brian Pane wrote: Ryan Bloom wrote: [...] +static const int MAX_SAVED_LENGTHS = 6; Why is this a static const istead of a #define? So that its scope will be limited to the enclosing function But why is that a good thing? This should be

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Ryan Bloom
On Wednesday 26 September 2001 06:57 pm, Brian Pane wrote: > Ryan Bloom wrote: > > [...] > > >+static const int MAX_SAVED_LENGTHS = 6; > > > >Why is this a static const istead of a #define? > > So that its scope will be limited to the enclosing function But why is that a good thing? This shou

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
Ryan Bloom wrote: [...] +static const int MAX_SAVED_LENGTHS = 6; Why is this a static const istead of a #define? So that its scope will be limited to the enclosing function --Brian

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Ryan Bloom
On Wednesday 26 September 2001 06:34 pm, Brian Pane wrote: > I instrumented apr_pstrcat and found that, in Apache 2.0, the number of > strings it's asked to concatenate is 6 or less 99+% of the time. > > apr_pstrcat does two passes through its args: one to compute the > length

[PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
I instrumented apr_pstrcat and found that, in Apache 2.0, the number of strings it's asked to concatenate is 6 or less 99+% of the time. apr_pstrcat does two passes through its args: one to compute the length, a second to do the copying. This patch adds a buffer to save the lengths of the fi

Re: apr_pstrcat()

2001-07-08 Thread rbb
On Sun, 8 Jul 2001, Cliff Woolley wrote: > On Sat, 7 Jul 2001 [EMAIL PROTECTED] wrote: > > > I think you misunderstand my meaning. > > Would you expect anything else? That's my specialty. ;-) I tend to jump ahead of myself and not explain what I mean. I just expect everybody to read my mind.

Re: apr_pstrcat()

2001-07-08 Thread Cliff Woolley
On Sat, 7 Jul 2001 [EMAIL PROTECTED] wrote: > I think you misunderstand my meaning. Would you expect anything else? That's my specialty. ;-) > We should do both. Cool. +1. --Cliff -- Cliff Woolley [EMAIL PROTECTED] Charl

Re: apr_pstrcat()

2001-07-08 Thread rbb
> On Sat, 7 Jul 2001 [EMAIL PROTECTED] wrote: > > > +1, personally I would prefer to have the length returned in the parameter > > list. > > I was leaning that way as well for consistency with apr_pstrcat(). > > > Or, we could do something I have been conside

Re: apr_pstrcat()

2001-07-08 Thread Cliff Woolley
On Sat, 7 Jul 2001 [EMAIL PROTECTED] wrote: > +1, personally I would prefer to have the length returned in the parameter > list. I was leaning that way as well for consistency with apr_pstrcat(). > Or, we could do something I have been considering since I started > APR. We cou

Re: apr_pstrcat()

2001-07-08 Thread rbb
On Sun, 8 Jul 2001, Cliff Woolley wrote: > > You know, it'd be really cool if there were a version of apr_pstrcat() > that returned the length of the concatenated output. There are LOTS of > places where we call apr_pstrcat() and then immediately have to call > strlen()

apr_pstrcat()

2001-07-08 Thread Cliff Woolley
You know, it'd be really cool if there were a version of apr_pstrcat() that returned the length of the concatenated output. There are LOTS of places where we call apr_pstrcat() and then immediately have to call strlen() on its output, when apr_pstrcat() itself is already computing the l