3 ms·
>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 pos
by 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.
- DoesntMatter22 3y agoPHP is interpreted and Elixir is compiled. Comparing them to Ruby and Python make no sense as they are interpreted as well. The fact that Elixir, a compiled language, known for speed, is slower than PHP is surprising. As far as "Most PHP libs are wrappers over C code". That's just not true. Most PHP libs are in PHP
- coldtea 3y ago>PHP is interpreted and Elixir is compiled. Comparing them to Ruby and Python make no sense as they are interpreted as well. The metric is speed. Compiled vs interpreted is an implementation concern. You can be compiled and slower than interpreted (and vice versa). >The fact that Elixir, a compiled language, known for speed Elixir is not compiled into binary. It's compiled to bytecode for the BEAM vm. And Elixir was never known for speed, nor was Erlang. They are known for parallelism, availability, fault tolerance, smart schedulling, etc.