3 ms·
Seconds? What libraries are you using? I develop professionally in PHP but use Python for most of my personal projects, and for scripting text files. Sometimes
by dotancohen 5y ago
Seconds? What libraries are you using?
I develop professionally in PHP but use Python for most of my personal projects, and for scripting text files. Sometimes I'll feel a few hundred miliseconds' delay and be surprised, but unless we're talking about a loop that probably should not loop seconds is a long time.
If you could share more of your workflow I'll be happy to advise.
- TekMol 5y agoSeconds are extreme examples of course, where heavy data processing is taking place. My guess is that CPython is something like 4x slower for typical code and even slower if most of the code is control structures like branching, loops, function calls etc.
- mgkimsal 5y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/php-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... There's a small set of benchmarks between php8 and python 3.9. Your 'guess' isn't too far off.
- deleted 5y ago[deleted]
- vadfa 5y agoI have tried to move some stuff from PHP to Python (using Flask for example - I don't want to imagine the performance of Django) and the difference in performance is pathetic. Especially given the reputation of both languages. Python is still easier so if you can throw money at AWS it is a better option.
- tyingq 5y agoWere you maybe using Python on AWS Lambdas? That would be relatively slow, since it takes away the advantage Python/Flask would have vs PHP...that it's already warm.
- dotancohen 5y agoIn PHP 7.4 PHP can be configured to precache (typically framework) files. Thus with mod_php (as opposed to FPM), Apache and the Zend engine are already warm.