socket send O(N**2) complexity
zac256 at gmail.com
Mon Sep 21 21:03:15 CEST 2009
The mysocket.mysend method given at
http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2)
complexity for long msg due to the string slicing.
I've been looking for a way to optimize this, but aside from a pure
python 'string slice view' that looks at the original string I can't
think of anything. Perhaps start and end keywords could be added to
send? I can't think of a reason for the end keyword, but it would be
there for symmetry.
Aim - Zac256FL
Production Engineer (Digital Overlord)
More information about the Python-list