First profile the Python app - is it being slow in Python or is it waiting on something else? If it is being slow in Python, can you rewrite the critical section in C? And speaking of which, is there a C API to your DB that you can use from Python? The Python mentality has always been that it is easy to interface Python and C where necessary for performance.
Or better yet, have a look at Cython or PyPy. Both give a performance advantage over the standard intepreter.
Ask HN: Python vs Scala for a fast web-project
11–15 of 15 posts
Re: Ask HN: Python vs Scala for a fast web-project
#12First profile the Python app - is it being slow in Python or is it waiting on something else? If it is being slow in Python, can you rewrite the critical section in C? And speaking of which, is there a C API to your DB that you can use from Python? The Python mentality has always been that it is easy to interface Python and C where necessary for performance.
No, there isn't a C API for the DB. So, that put C out of the picture for us.
Re: Ask HN: Python vs Scala for a fast web-project
#13Re: Ask HN: Python vs Scala for a fast web-project
#14Re: Ask HN: Python vs Scala for a fast web-project
#15If your goal is to launch, stop fooling around with languages and rewriting your code. What exactly was slow?
2) Using Flask gave us so much flexibility as a framework. SQLAlchemy was probably the best thing that I've ever seen. But the work was made complex by the fact that Python was not able to give us the performance that we wanted. We tested the web-project running locally, and we noticed some exciting results. Even though we had done proper memory management from our side, the memory consumption was a little high than we had actually expected. I'm not an expert web-technologies, but as a programmer for last n years, I've learnt a lot about memory management. We projected that when the load would be actual, python performance would suffer.
3) We wanted a real-time performance application so that the user experience was the best. We implemented a part of the web-application and tested it. The results were unsatisfactory. Then we planned on shifting to scala.