Live data from Hacker News

Ask HN: Python vs Scala for a fast web-project

news.ycombinator.com

11–15 of 15 posts

Re: Ask HN: Python vs Scala for a fast web-project

#11
post #5
post #3

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.

The API problem will still exist even if we switch to PyPy or Cython.

Re: Ask HN: Python vs Scala for a fast web-project

#12
post #7
post #3

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.

No, there isn't a C API for the DB. So, that put C out of the picture for us.

Out of curiosity, may I ask which DB this is?

Re: Ask HN: Python vs Scala for a fast web-project

#15

If your goal is to launch, stop fooling around with languages and rewriting your code. What exactly was slow?

1) A NoSQL database best suited our project. So, the non-nativeness was a hurdle. Neo4j bindings for Python used JPype, which was rather unmaintained. And I read at some places that it was a bad idea to mix python-java (especially using the unmaintained JPype).

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.

Post reply on HN