Re: django/python performance vs play/java

2011-07-08 Thread Venkatraman S
On Fri, Jul 8, 2011 at 8:03 PM, akaariai wrote: > > Trying jinja2 in your project is hard - you are using some template > tags, and you would need to port them to jinja2. Then you would need > to rewrite your templates so that they work under jinja2. This would > take some time for sure. > > What

Re: django/python performance vs play/java

2011-07-08 Thread akaariai
On Jul 8, 4:03 pm, drakkan wrote: > I have no time to try jinja2 now, I guess it should speed up django a > bit Trying jinja2 in your project is hard - you are using some template tags, and you would need to port them to jinja2. Then you would need to rewrite your templates so that they work unde

Re: django/python performance vs play/java

2011-07-08 Thread drakkan
On 8 Lug, 14:44, Thomas Guettler wrote: > On 06.07.2011 15:33, drakkan wrote:> On 6 Lug, 14:03, akaariai > wrote: > >> On Jul 5, 10:54 pm, drakkan wrote: > > ... > > > using pgpool I get a 2,5x performance improvement thanks! I'll try on > > intel atom again to see if there I have more improv

Re: django/python performance vs play/java

2011-07-08 Thread Thomas Guettler
On 06.07.2011 15:33, drakkan wrote: > On 6 Lug, 14:03, akaariai wrote: >> On Jul 5, 10:54 pm, drakkan wrote: ... > using pgpool I get a 2,5x performance improvement thanks! I'll try on > intel atom again to see if there I have more improvements Hi, I am interessted in the result. Please post

Re: django/python performance vs play/java

2011-07-07 Thread Jason
I recommend you give this a shot: http://backslashn.com/post/505601626/profiling-execution-with-the-django-debug-toolbar It might give some clues and is VERY fast to setup. On Jul 6, 8:44 am, drakkan wrote: > You can download the code here: > > http://77.43.75.110/temp/cinquestelle.tar.gz > > y

Re: django/python performance vs play/java

2011-07-07 Thread Jason
Good catch. Drakkan, I suggest trying out this ProfilingPanel for the Django Debug Toolbar (very easy to setup). http://backslashn.com/post/505601626/profiling-execution-with-the-django-debug-toolbar I'd be very curious to know what you find. On Jul 7, 8:16 am, akaariai wrote: > On Jul 6, 6:44

Re: django/python performance vs play/java

2011-07-07 Thread Venkatraman S
On Wed, Jul 6, 2011 at 7:21 PM, akaariai wrote: > > The best way to check where your performance problems come from is > using profiling. > > In my experience, the most likely things to cause you performance > problems in Django are database queries and template rendering. If > template rendering

Re: django/python performance vs play/java

2011-07-07 Thread akaariai
On Jul 6, 6:44 pm, drakkan wrote: > You can download the code here: > > http://77.43.75.110/temp/cinquestelle.tar.gz > > you need sorl as dependencies too: > > http://pypi.python.org/pypi/sorl-thumbnail/3.2.5 > I took a quick look of the source. I think the limiting factor for you is template ren

Re: django/python performance vs play/java

2011-07-06 Thread drakkan
You can download the code here: http://77.43.75.110/temp/cinquestelle.tar.gz you need sorl as dependencies too: http://pypi.python.org/pypi/sorl-thumbnail/3.2.5 On 6 Lug, 15:57, Björn Lindqvist wrote: > 2011/7/6 drakkan : > > > Bruno, I'm talking about an high level framework such as play (ht

Re: django/python performance vs play/java

2011-07-06 Thread Björn Lindqvist
2011/7/6 drakkan : > Bruno, I'm talking about an high level framework such as play (http:// > www.playframework.org/). Develop an application with play is as simple > as a django one, until now I used django and I like python more than > java and I want to understand if I'm doing something wrong or

Re: django/python performance vs play/java

2011-07-06 Thread akaariai
On Jul 6, 4:33 pm, drakkan wrote: > using pgpool I get a 2,5x performance improvement thanks! I'll try on > intel atom again to see if there I have more improvements The best way to check where your performance problems come from is using profiling. In my experience, the most likely things to ca

Re: django/python performance vs play/java

2011-07-06 Thread drakkan
On 6 Lug, 14:03, akaariai wrote: > On Jul 5, 10:54 pm, drakkan wrote: > > > so play is outperforming django! obviously django is not in debug mode > > ecc..., is there something wrong in my test setup (I already tried to > > adjust the uwsgi launch line I tryed more process or 1 process with > >

Re: django/python performance vs play/java

2011-07-06 Thread Shamail Tayyab
Pretty interesting.. So, I've an idea here.. Why don't you log this output in some file.. (and share) def page (request): start = time.time() # function definition elapsed = (time.time() - start) return HttpResponse() This way, see if its the framework that's taking the time, or its

Re: django/python performance vs play/java

2011-07-06 Thread akaariai
On Jul 5, 10:54 pm, drakkan wrote: > so play is outperforming django! obviously django is not in debug mode > ecc..., is there something wrong in my test setup (I already tried to > adjust the uwsgi launch line I tryed more process or 1 process with > threads ecc with no relevant improvement) or d

Re: django/python performance vs play/java

2011-07-06 Thread Uros Trebec
Hi, Have you tried any kind of DB connection pooling with Django? I find Jacob's Deployment Workshop [0] to be a treasure chest of tips and tricks for Django deployment. Also take a look at the code/config he uses [1]. [0] http://ontwik.com/python/django-deployment-workshop-by-jacob-kaplan-moss/

Re: django/python performance vs play/java

2011-07-06 Thread drakkan
On 6 Lug, 12:46, Thomas Guettler wrote: > Hi, > > I would choose the framework, that you like. You can optimize later. And > this would be the same for all frameworks: You need a good cache strategy. > > Are you expecting several hundred requests per minute? > > I guess there is something wrong

Re: django/python performance vs play/java

2011-07-06 Thread Thomas Guettler
Hi, I would choose the framework, that you like. You can optimize later. And this would be the same for all frameworks: You need a good cache strategy. Are you expecting several hundred requests per minute? I guess there is something wrong with your benchmark. I don't think django/python is muc

Re: django/python performance vs play/java

2011-07-06 Thread bruno desthuilliers
On Jul 6, 10:35 am, drakkan wrote: > Bruno, I'm talking about an high level framework such as play > (http://www.playframework.org/). > Develop an application with play is as simple as a django one, The framework might be fine (I'll give the doc a read), but the language still sucks ;) But anyw

Re: django/python performance vs play/java

2011-07-06 Thread drakkan
On 5 Lug, 22:57, bruno desthuilliers wrote: > On 5 juil, 21:54, drakkan wrote: > > (snip) > > > or django/python is simply much slower than java? > > According to most benchmarks, Python (that is: current canonical > implementation of...) is indeed way "slower" than Java (idem), that's > a fact

Re: django/python performance vs play/java

2011-07-05 Thread Kenneth Gonsalves
On Tue, 2011-07-05 at 13:57 -0700, bruno desthuilliers wrote: > To make a long story short: if you're looking for raw execution speed, > forget about Java and go for C - and let us know when you'll have a > working prototype. or like the facebook guys write C in php. -- regards KG http://lawgon.

Re: django/python performance vs play/java

2011-07-05 Thread Xavier Ordoquy
Hi, Is there anyway you can upload the project to bitbucket or github ? Regards, Xavier. Le 6 juil. 2011 à 01:31, drakkan a écrit : > Hi, > > thanks for your comments, I installed django-debug toolbar and I can > confirm I'm doing similar queries from both django and play. The query > I do wit

Re: django/python performance vs play/java

2011-07-05 Thread drakkan
Hi, thanks for your comments, I installed django-debug toolbar and I can confirm I'm doing similar queries from both django and play. The query I do with hibernate in play should be slower since I'm doing a left outer join while django do an inner join, since the field on which I join cannot be nu

Re: django/python performance vs play/java

2011-07-05 Thread Jonas Geiregat
We all know python is slower in raw execution speed than it's brother Java but I can't imagine it to be _that_ slow. Maybe there's something wrong with the queries you perform. Django's ORM is know for it's 'hidden execution' of queries. Some more insight in your querying code might be useful

Re: django/python performance vs play/java

2011-07-05 Thread Xavier Ordoquy
Hi, Install Django debug toolbar and have a look at what's wrong with your application. My numbers are very different from yours. I just ran some tests and I am around 350 req/s with 4 sql queries. I'm a on dual core (4 virtual cores), using gunicorn/mysql with debug turned off, 4 workers proce

Re: django/python performance vs play/java

2011-07-05 Thread Maksymus007
Of course Java IS faster by a few factors then Python. I switched recently to Play development from django and I also noticed different. Moreover Play uses many mature tools, like JPA/Hibernate, ehcache etc which are called industrial standards. One more thing - Play! uses its own build-in http ser

Re: django/python performance vs play/java

2011-07-05 Thread bruno desthuilliers
On 5 juil, 21:54, drakkan wrote: (snip) > or django/python is simply much slower than java? According to most benchmarks, Python (that is: current canonical implementation of...) is indeed way "slower" than Java (idem), that's a fact. FWIW, according to the same benchmarks, Java is slower than

django/python performance vs play/java

2011-07-05 Thread drakkan
Hi, I did a small test app that basically render a web page and do 3 queries to the database (these queries are needed to fetch some data displayed on the web page). I deployed this app with nginx+uswgi here is the relevant nginx conf: location / { uwsgi_pass 127.0.0.1:49152;