Larry Hastings wrote:
> It's *slightly* slower for two:
>
> def addTwoThings(a, b):
>     return a + b
> for i in range(10000000):
>     x = addTwoThings("aaa", "bbb")
...
> But starts paying off already, even with three:
>
> def addThreeThings(a, b, c):
>     return a + b + c
> for i in range(10000000):
>     x = addThreeThings("aaa", "bbb", "ccc")

I note that in both of those tests you didn't actually ever realise the
concatenated string.  Can you give us figures for these tests having
forced the concatenated string to be computed?

Cheers,
    Nicko

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to