Code written in "C" routinely executes<div>90% as fast as the assembly code</div><div>written by a typical programmer. But</div><div>that's not a straightforward comparison</div><div>either. It depends on how well the optimizers</div>
<div>in a compiler work - pretty well in gcc I think.</div><div>But there are also optimizers for assemblers</div><div>which can literally rearrange code in order to</div><div>get the maximum work done per CPU cycle.</div>
<div>It takes a long time, but it can be done.</div><div><br></div><div>All of these things are expensive, and likely</div><div>worth it only for time critical applications,</div><div>and, I'd think, the core pieces of an OS that</div>
<div>get used frequently. Execution profiles can</div><div>show what those are, and where it pays to</div><div>spend time and money.</div><div><br></div><div>But good programmers in assembly </div><div>are not common, and probably mostly get</div>
<div>gobbled up by the military, and other </div><div>organizations where speed is crucial and</div><div>cost is no object.</div><div><br></div><div>Etc. Leading to the question, if PHP is </div><div>so bad, why is it so prominently used? Why</div>
<div>are so many willingly using garbage? Or,</div><div>why is it that some think it's good? </div><div><br></div><div>Most people have their own little bag of</div><div>tricks that will get many small things done</div>
<div>quickly. Many of us conjure small shell</div><div>scripts, and save them, to do many</div><div>little file manipulation and other chores.</div><div>Most of them will never become real,</div><div>maintained, programs, but get the job</div>
<div>done. It's when something bigger and</div><div>marketable is wanted that the choice of</div><div>platform has to be made.</div><div><br></div><div>So why PHP? Is there something unique</div><div>that only it does? Or is it maybe that finding </div>
<div>people that know something about it</div><div>is easier than finding people who know</div><div>something about a better approach? </div><div><br></div><div> --Bob</div><div><br></div><div><div><br><div class="gmail_quote">
On Mon, Feb 1, 2010 at 10:24 AM, Adam Tauno Williams <span dir="ltr"><<a href="mailto:awilliam@whitemice.org">awilliam@whitemice.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, 2010-02-01 at 10:01 -0500, Bob Kline wrote:<br>
> Uhmmm, isn't execution speed and<br>
> coding speed the usual tradeoff with<br>
> high level languages? A shell script<br>
> can get small things done in a hurry.<br>
> No one expects it to execute fast. Or<br>
> should anyway.<br>
<br>
</div>Once upon a time; these days, for most use-cases, the difference is<br>
pretty minimal. But PHP performance in many cases is *BAD*, as in<br>
terrible, as in minutes vs. seconds.<br>
<div class="im"><br>
> Isn't it usually the case that one<br>
> needs a compiled version of high<br>
> level code before the speed improves?<br>
> As in an order of magnitude and more?<br>
<br>
</div>No. It might be true if that 'low-level' code was always optimal, but<br>
it isn't. So while maybe true in some theoretical sense this simply is<br>
not true in reality.<br>
<div class="im"><br>
> High level languages keep people<br>
> from having to learn things like assembly<br>
> language and "C," reduce expensive<br>
> labor costs, and exploit cheaper, faster<br>
> hardware, but I'd of thought that it was<br>
> clear what the price of them is.<br>
> They are relatively slow. You never get<br>
> it all.<br>
<br>
</div>With current optimizing aot runtimes this is simply no longer true.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
grlug mailing list<br>
<a href="mailto:grlug@grlug.org">grlug@grlug.org</a><br>
<a href="http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug" target="_blank">http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug</a><br>
</div></div></blockquote></div><br></div></div>