mk wrote:

> Now C++ version took over twice the time to execute in comparison to
> Python time!

> Am I comparing apples to oranges? 

Indeed. Where in Python you're passing references your C++ code produces
copies of the vector. For starters you can change the function signature to

void move_slice(vector<string>& vec, int start, int stop, int dest)

which should already give your C++ implementation a significant speed boost.

Peter

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

Reply via email to