From: Luke Ivers Date: 2007-02-09T06:11:20+09:00 Subject: Re: Help optimizing Luke Ivers wrote: >> And, make the string / stream to append to a parameter. That way you >> don't need to create potentially large strings during recursion before >> you append them but you can directly append - you basically just have >> one. >> > This one was great: using two functions as I did in one of the earlier > emails, however, still provides a significant speed bump over a > top-level if-else decision on parent==''. > > I changed the two-function thing to pass the returned string as a param, > and re-wrote the original function using exactly your suggestions, > giving these benchmarks: > > robert 4.414000 0.000000 4.414000 ( 4.461000) > two-fun 4.088000 0.000000 4.088000 ( 4.097000) Oh, and I used str.concat: should I have used something else? -- Posted via http://www.ruby-forum.com/.