I have an assignment every week of the heuristic problem solving course. The assignments are taking up at least 3-4 days of my week (I want to reduce this time). The questions asked in the assignment are computationally intensive and we need to give our best answer within a program execution time of 2 min. I started doing assignments in c++ for good runtime performance. Fine. But, I would have to end up using pointers etc so as not to create copies of data everywhere. But this usually resulted in more debugging time. So I switched to java for my next assignment. A little low on performance compared to c++ but is saving my weekends.
I profiled my java program and saw that a single function was taking up 95% of the cpu time. In this context I want to ask, if I use python to write my assignment solution, profile it, find out the functions using up the most cpu time, implement them using c-modules.. can I do any better? I can decrease my development time (bcz I personally find development on python to be faster) and since I would implement the functions which take up 95% of cpu time in c-modules I should not take a hit on performance.
Is this something I can try? I can try this out (python + c-modules) and check out for myself (without asking for help here), but if I fail I might not have time to re-implement my whole assignment in c++ or java.
If performance is what you are looking for, you should know that Python is 10 to 100 times slower than C++. Depending on how much performance you are looking for, you may come around by optimizing your code or use some 3rd party libraries for number crunching as scipy.
Using Cython would be an option for consideration, but you were looking for decreasing the development time by using python? Using C-Modules would introduce more complexity and Cython has a different syntax anyway.
Performance of Python with c modules