3 ms·
It's amazing how much faster dynamic languages can run with some engineering effort. It's also frustrating, because it contrasts starkly with my PHP code's perf
by Joeri 15y ago
It's amazing how much faster dynamic languages can run with some engineering effort. It's also frustrating, because it contrasts starkly with my PHP code's performance. I wish the PHP team had the resources to do this kind of work, because at this point it's the slowest subcomponent in my stack.
- SpikeGronim 15y agoHave you tried HipHop? https://github.com/facebook/hiphop-php https://github.com/facebook/hiphop-php
- true_religion 15y agoThat is a PHP to C compiler, is it not?
- kingkilr 15y agoWrong on both (but not far off) :P a) It's a "restricted subset of PHP" it doesn't compile the entire language, b) it compiles to C++.
- true_religion 15y agoWow. Anytime I hear about people choosing C++ as their target, I have mingled feelings of awe and uneasiness.
- jey 15y agoHopefully projects like HLVM will be able to fix that by proving a very good target for dynamic language implementations. It's a very ambitious project that's in relatively early stages, but seems promising.
- wanderr 15y agoIs that still true for you if you use APC? What if you use nginx instead of Apache? In our experience, APC makes an order of magnitude difference, and nginx makes several.
- masklinn 15y ago> It's amazing how much faster dynamic languages can run with some engineering effort It's a bit more than just "some", and it's an evolution 20 years[0] in the making[1]. [0] http://en.wikipedia.org/wiki/Self_(programming_language) http://en.wikipedia.org/wiki/Self_(programming_language) [1] http://en.wikipedia.org/wiki/StrongTalk http://en.wikipedia.org/wiki/StrongTalk
- eneveu 15y agoI learned about this when watching Avi Bryant's great talk "Bad Hackers Copy, Great Hackers Steal" : http://vimeo.com/4763707 http://vimeo.com/4763707 He explains that dynamic languages are not inherently slow. It's their current implementation that's slow. Java is not fast thanks to static typing, it is fast thanks to the Hotspot VM, which builds upon the StrongTalk VM implementation. Quote taken around the 13" mark (some trolling included ;) ): "Ruby has the dynamic part, and Java has the fast part. And this has led to this assumption that people have that the reason that Java is fast and Ruby is slow is because Java is static and Ruby is dynamic. And that's just not true, that's just a myth. Nothing about Java being fast has anything to do with it being static. It's simply that the papers that the Java people read were the ones that told you how to make it fast, and the papers that Matz read were the ones that told you how to make it usable."
- wingo 15y ago> I wish the PHP team had the resources to do this kind of work, because at this point it's the slowest subcomponent in my stack. That's a business opportunity. PHP is not my bag, but an interested compiler hacker could make a quick trace JIT (a la Dalvik), license it out, and probably get a fair bit of cash.
- getsat 15y agoapt-get install php5-xcache