B
Bartc
Flash Gordon said:Bartc wrote, On 08/10/08 23:38:
Note that as has been pointed out you are calling strlen above so you
could actually use the correct values for whatever parameters are passed
in with no additional overhead.
?
Well, 1.8 seconds is less than 2 seconds. Note what I say above about
already having the correct numbers available programatically for the
memcpy calls.
Well, since less than 2 seconds is less than "nearer 2 seconds" and
significantly less than 2.5 seconds you have now shown that C is faster
than Python for this task if you write efficient C.
Only just, and by pretending that string lengths are available. Normally
they are not without extra effort.
But other posters have said their C code is quite a bit faster than Python,
by the sort of factors I would have expected.