-4

Suppose you have written a prototype for an application in python, now you want to rewrite it in c++ for speed reasons and to make a real software out of it.

What are things to consider before starting to do this?

I read a couple of posts about "Big Rewrite", but i am unsure if this is the same or different topic?

Is it a good strategy to try to copy every function as similar as possible and rewrite function for function?

For every special purpose library like the logging module/pandas/etc. Do you look for a similar library in C++?

1 Answers1

2

Figure out where speed is actually needed.

Rewriting all your code is almost certainly not necessary as it is only going to be in a few places (likely) where speed is really needed. Also remember that many attempts to increase speed would be more appropriately solved with things like a queue. You can create wrappers to just run the Python code from your C++ program which will save a heck of a lot of time.

Also, if you just require more speed, see if you can get the speed from just a better Python implementation. There are so few use cases where C++ is actually required to make a difference.