> At 04:10 PM 11/5/2003 -0700, Luke Palmer wrote: > >Actually that was pretty good for an early version. You could help IMCC > >out by not creating those PerlUndefs until you're going to assign to > >them. > > Also, anytime you use a temporary to assing a constant literal, you > should be able to use a I/S/N reg. Parrot's ops are polymorphic > so you should have a lot of flexibility even with the basic types. > > >Vtable jump isn't really that much overhead in a language like C. > >Parrot's already running pretty fast. We're making things fast by > >keeping it in mind while implementing it, including a rich opcode > >and vtable so the number of said slow dispatches are small, among other > >various things that I don't know. Maybe Dan will chime in here :-) > > Thies, have you actually benchmarked your sample > with JIT against PHP? >
A bench with a mandelbrot set of depth 500 (script attached):: php mandel2.php 1.93s user 0.01s system 76% cpu 2.552 total ../../parrot/parrot mandel.imc 1.08s user 0.02s system 41% cpu 2.643 total ../../parrot/parrot -j mandel.imc 0.77s user 0.01s system 57% cpu 1.368 total Is the result. > >It's great that you're doing PHP for Parrot. > > > >Luke > > Darn right! > Btw, incase people on the list are interested there is a presentation about PHP and Parrot we did at http://www.edwardbear.org/pap.pdf -Sterling
<?php $b = " .:,;!/>)|&IH%*#"; $y=0; $C=0; $x=0; $c=0; $z=0; $Z=0; $t=0; $k=0; $i=0; $r=0; //float r, i, z, Z, t, c, C; for ($y=30; $C = $y*0.1 - 1.5, $y--;){ echo "\n"; for ($x=0; $c = $x*0.04 - 2, $z=0, $Z=0, $x++ < 75;){ for ($r=$c, $i=$C, $k=0; $t = $z*$z - $Z*$Z + $r, $Z = 2*$z*$Z + $i, $z=$t, $k<500; $k++) if ($z*$z + $Z*$Z > 10) break; echo $b[$k%16]; } } echo "\n"; ?>