Re: str.Template 4 times slower than calling replace multiple times

2009-03-08 Thread Chris Rebert
On Sun, Mar 8, 2009 at 10:23 PM, John Machin wrote: > On Mar 9, 3:15 pm, Jack Steven wrote: >> Isn't string.Template suppose to be faster than calling replace multiple >> times? That's what I thought until I benchmarked this code, where >> string.Template ended up being 4 times slower. >> >> This

Re: str.Template 4 times slower than calling replace multiple times

2009-03-08 Thread John Machin
On Mar 9, 3:15 pm, Jack Steven wrote: > Isn't string.Template suppose to be faster than calling replace multiple > times? That's what I thought until I benchmarked this code, where > string.Template ended up being 4 times slower. > > This doesn't make sense to me, since unlike when you are calling

str.Template 4 times slower than calling replace multiple times

2009-03-08 Thread Jack Steven
Isn't string.Template suppose to be faster than calling replace multiple times? That's what I thought until I benchmarked this code, where string.Template ended up being 4 times slower. This doesn't make sense to me, since unlike when you are calling replace multiple times, code behind Template ca