4 ms·
Elixir is slower than plain PHP according to the techempower benchmarks. I'm not even sure how that's possible but it is. By like a factor of 2 iirc. I'm not su
by DoesntMatter22 3y ago
Elixir is slower than plain PHP according to the techempower benchmarks. I'm not even sure how that's possible but it is. By like a factor of 2 iirc. I'm not sure how elixir is that slow since it's compiled.
- te_chris 3y agoPHP is fast these days raw-speed wise. Concurrency and parallelism matter more than speed as they translate directly to utilisation.
- abrookewood 3y agoYes, calling something Fast can mean many different things. Erlang/Elixir are not 'fast' at number crunching, but they are very good at concurrency.
- Cthulhu_ 3y agoIt depends on what is actually being benchmarked though; if it's the simple JSON payload, more time will be spent on HTTP parsing (done in nginx for the PHP benchmark so really really fast) and some JSON parsing (done in a C library for the PHP benchmark so really really fast). Basically, how much PHP is actually being benchmarked? Are you looking at a benchmark that compares real-world usage, or a microbenchmark like hello world or a small JSON payload?
- DoesntMatter22 3y agoThat's a reasonable point. This is Techempower as I mentioned originally. In pretty much all the benchmarks PHP smokes Elixir
- coldtea 3y ago>Elixir is slower than plain PHP according to the techempower benchmarks. I'm not even sure how that's possible but it is. You're "Not even sure how that's possible" as if implying PHP is slow? Even old pre-7 PHP was much faster than Ruby, Python, and others. And most PHP libs are just wrappers over C code.
- morelisp 3y ago> Even old pre-7 PHP was much faster than Ruby, Python, and others. No, PHP 7 was an impressive step forward in speed because it switched to better bytecode and object representations internally, but Python wiped the floor with most versions of PHP 5 for exactly the same reason. (PHP 5.5 with opcaching was roughly comparable.) But this comparison overall is like trying to find the strongest two-year-old...
- dahwolf 3y agoIt's a ridiculous thing to say that any version of PHP is slow. You could run PHP5 today and it's still not slow by any modern standard. Even on the hardware of 15 years ago almost any script you throw at it finishes in single digit milliseconds. How is that slow? I'd like to meet the developers that consider this slow.
- ndriscoll 3y agoI guess it depends on what the script is doing, but I'd consider that slow. Code I've worked on in Scala takes more like 50-60 microseconds per http request for a json CRUD type of thing (plus latency to wait for the db, but it can serve other requests during that time).
- morelisp 3y agoLadies and gentlemen, the strongest two-year-old.
- coldtea 3y agoThe strongest within a certain category is still a useful concept. If one is looking for a strong pickup truck, they don't care that a 18-wheeler is stronger, as that's in another category they have no use for. One might want to pick among "scripting languages with suitability for web coding and great adoption" for example...
- mabbo 3y agoRuby and Rails especially, aren't fast in terms of fast running programs. But they are fast in terms of launching features quickly. Playing with Elixir, I feel similar speed of development, but it also comes with speed of running, which is incredible.
- octacat 3y agoBecause they are different languages with different VMs and different concerns. Made for different purposes. Number crunching is slower in Erlang VM (you can call C code though).
- di4na 3y agoThe techempower benchmark are... Quite infamous in the elixir community. Long story short, they are running in debug mode, badly written, not optimised, with bad OS level settings. And every time the community have tried to contribute fixes, the experience has been... Really bad. So we stopped trying. If things have changed we could try again but ... We just wrote them off
- wredue 3y agoAs far as I can tell, you’re basing this off a single thread from a prior techempower round. The result being cleaned up in a subsequent round, but are ignoring that.