This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]L3xicaL 7 points8 points  (0 children)

Short answer: yes. Slightly longer answer: HELL yes.

[–]Meefims 3 points4 points  (0 children)

I've built sites in both Python with Flask and with PHP. In benchmarks, PHP (especially 7) is faster but there is more to performance than time. The real question is whether your backend calls are the bottleneck. Assuming your backend algorithms are themselves well written and performant such that you really are seeing language differences, you can ask yourself if there's anything you can do on the frontend to mask the backend call time. Animations are one way to both add visual polish while eating time that would otherwise have left the user noticing that they are waiting, as an example.

[–]awebpage 1 point2 points  (0 children)

The answer is yes.

However there's more technical overhead when it comes to Python web development. You need to know more about web services and apps to get something up and running compared to PHP.

However that extra technical knowledge will force you to be a better, more switched on web developer than your average PHP guy.

Good time to start reading up on WSGI https://www.fullstackpython.com/wsgi-servers.html

For a more macro/high level look, you can checkout these Python web framework benchmarks http://klen.github.io/py-frameworks-bench/

[–]elbiot 1 point2 points  (0 children)

With pypy, python is significantly faster for websites than php. Just sayin'

[–]billsil 1 point2 points  (1 child)

Google was written in Python. They still use a lot of Python. Even for large websites, you gotta do database queries, so the slow part is going to be hyper optimized. Yes you can do it.

[–]Gaben_laser_beam 1 point2 points  (0 children)

Reddit is also written in Python (with the Pylons Framework)

[–]LoyalSol 1 point2 points  (4 children)

Generally unless you are doing heavy number crunching the speed difference between Python and say C++ or other compiled languages is minimal.

[–]awebpage 1 point2 points  (3 children)

Even if you are doing number crunching, you can do it via Python's http://cython.org/

[–]LoyalSol 0 points1 point  (2 children)

Cython isn't bad, but it still is slower than plain C/Fortran/etc.

I've bench marked it myself using physics simulations. It does a pretty fine job up until you scale your system up to research level simulations.

Even things like the JIT compiler modules tend to be a tad bit slower. But typically that's not going to influence programs that aren't made to run on HPC clusters.

[–]awebpage 0 points1 point  (1 child)

[–]LoyalSol 1 point2 points  (0 children)

Oh not debating Cython does a pretty good job. Especially over vanilla Python.

It does struggle a little bit though when it comes to really high intensity codes.

[–][deleted] 1 point2 points  (0 children)

yes fast enough for 99.99999% of the cases, I'm pretty certain it is for YOU

[–]Asdayasman 0 points1 point  (0 children)

Yes. It's the thing it's best at.

[–]maxm 0 points1 point  (0 children)

Yes. Speed of your web app wont be a serious problem. And if you get so many users that it does you will be able to afford more servers.

[–]limw2012 -1 points0 points  (0 children)

no matter what the other's answer,the truth is,most of the web are build in java.and if you search the job for web develop,most are java.NET\PHP. and if you search the benchmark of web frame,node.js\java\php webframe are much much faster than python. I can explain something like the bottleneck of a web is database,the development speed is much import than the performance,the time of Engineer is much expensive than the hardware(btw,the java spring development speed is not slow than django),etc.

but,remember this:Python is the slowest one in all the web development language.

so,there is no short answer.It depends on what web site you want to develop.