The top reply says "Don't underestimate PHP when regexes are involved." and linked a benchmark [1]. But in that benchmark apparently Rust is faster than PHP (The slowest "Rust #2" is 2.45 sec. while PHP is 2.80 sec. He also mentioned "PCRE", but the ones with Perl in name are even much more slower [the fastest being 14.95 sec.]). Did I miss his point by linking that benchmark, or did I interpret the benchmark wrong?…
How come PHP seems so much faster than Rust?
81–90 of 116 posts
Re: How come PHP seems so much faster than Rust?
#82Earlier quoted context omitted.
If the majority of frameworks for a language are vunerable it's the language's fault. Python definitely doesn't have that issue, Rust and Go don't either.
> majority of frameworks for a language are vunerable Where's your proof? Modern PHP frameworks are secure by default.
Re: How come PHP seems so much faster than Rust?
#83Earlier quoted context omitted.
ASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed…
Why did php beat perl?
Re: How come PHP seems so much faster than Rust?
#84Earlier quoted context omitted.
I don't like it from the security perspective, looking at just how many vulnerabilities PHP-based software has had, it's too trivial to create a XSS, SQLi, CSRF, LFI, RCE and many other classes of vulnerabilities. I think there are better options out there than on average give better results. Maybe it's just incredible selection bias I'm encountering \ shrug .
It’s really easy to write PHP, which means that people who don’t know about escaping input write PHP. While there are some web-focussed languages (vs frameworks) that deliberately make it hard for you to write that sort of code, barely anyone uses them.
Not trying call you out on this point, more it made me laugh. Our lead developer strips out characters that break his XML importer (lets just say they are standard common characters, heck, he changes chr(13) to a string so he can switch it back later because he doesn't know how to handle multiple lines in an XML value). People who don't know how to escape inputs / actually handle data properly are in every language. We cringe on a daily basis.
Re: How come PHP seems so much faster than Rust?
#85I believe the Rust Regex Unicode support is opt-out, where as in PHP it is opt-in. Might make a significant difference.
https://docs.rs/regex/1.3.1/regex/#opt-out-of-unicode-suppor...
Re: How come PHP seems so much faster than Rust?
#86Re: How come PHP seems so much faster than Rust?
#87Random guess: There will be some difference in the regex engine speed, because PCRE is very fast in common cases. But doing a single regex match is not that much work, so it probably boils down to I/O. And PHP might use extra buffering to get better throughput for the common "stream a file" scenario. Similar question with Python being faster than C++: https://stackoverflow.com/questions/9371238/why-is-reading-l...
> And PHP might … The program source code is shown.
Re: How come PHP seems so much faster than Rust?
#88Earlier quoted context omitted.
ASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed…
Why did php beat perl?
Re: How come PHP seems so much faster than Rust?
#89Re: How come PHP seems so much faster than Rust?
#90Earlier quoted context omitted.
CGI yes, ASP certainly not.
ASP was inaccessible for younger developers, tinkering with a linux box after school.
Getting access to a Windows box was never a problem in countries with more flexibility towards piracy.
80 and 90's Portuguese students could get whatever they wanted from shaddy shops that used to copy books and software.
Booklets with 200+ items on them.