Connecting Tech Pros Worldwide Help | Site Map

framework & speed

chiefprogramer@gmail.com
Guest
 
Posts: n/a
#1: Jul 17 '05
How to build up a good frame for a mathematical system and it's
ultra-high-speed?

Althought In PHP 5 there is a new Object Model.
But I think the new Object Model is still very slow ><

Just like statement
"f();" cost 1148 ns
"fffffffffff();" cost 1273 ns (1 function char cost 13 ns)
"$z->f();" cost 1865 ns
"$z->fffffffffff();" cost 2857 ns (1 function char cost 110 ns)
"$v = 1;" 296 ns
"$vvvvvvvvvvv = 1;" 393 ns (1 char cost 10 ns)
"$z->v = 1;" 776 ns
"$z->vvvvvvvvvvv; = 1" 985 ns (1 char cost 23 ns)
.....


(All statement test by my slow computer...)

WindAndWaves
Guest
 
Posts: n/a
#2: Jul 17 '05

re: framework & speed



<chiefprogramer@gmail.com> wrote in message news:1107845583.113030.266970@l41g2000cwc.googlegr oups.com...[color=blue]
> How to build up a good frame for a mathematical system and it's
> ultra-high-speed?
>
> Althought In PHP 5 there is a new Object Model.
> But I think the new Object Model is still very slow ><
>
> Just like statement
> "f();" cost 1148 ns
> "fffffffffff();" cost 1273 ns (1 function char cost 13 ns)
> "$z->f();" cost 1865 ns
> "$z->fffffffffff();" cost 2857 ns (1 function char cost 110 ns)
> "$v = 1;" 296 ns
> "$vvvvvvvvvvv = 1;" 393 ns (1 char cost 10 ns)
> "$z->v = 1;" 776 ns
> "$z->vvvvvvvvvvv; = 1" 985 ns (1 char cost 23 ns)
> ....
>
>
> (All statement test by my slow computer...)
>[/color]

may I ask, what is your question?


Jerry Stuckle
Guest
 
Posts: n/a
#3: Jul 17 '05

re: framework & speed


chiefprogramer@gmail.com wrote:[color=blue]
>
> How to build up a good frame for a mathematical system and it's
> ultra-high-speed?
>
> Althought In PHP 5 there is a new Object Model.
> But I think the new Object Model is still very slow ><
>
> Just like statement
> "f();" cost 1148 ns
> "fffffffffff();" cost 1273 ns (1 function char cost 13 ns)
> "$z->f();" cost 1865 ns
> "$z->fffffffffff();" cost 2857 ns (1 function char cost 110 ns)
> "$v = 1;" 296 ns
> "$vvvvvvvvvvv = 1;" 393 ns (1 char cost 10 ns)
> "$z->v = 1;" 776 ns
> "$z->vvvvvvvvvvv; = 1" 985 ns (1 char cost 23 ns)
> ....
>
> (All statement test by my slow computer...)[/color]


If speed is your primary concern, don't use an interpretive language
like PHP. FORTRAN, C or C++ would be better (of course assembler is
best of all :-) ).

You don't necesarily have to implement everything in a compiled
language; you can implement the most critical and time-consuming
functions there and do the rest in PHP, for instance.

--

To reply, delete the 'x' from my email
Jerry Stuckle,
JDS Computer Training Corp.
jstucklex@attglobal.net
Member of Independent Computer Consultants Association - www.icca.org
NC
Guest
 
Posts: n/a
#4: Jul 17 '05

re: framework & speed


chiefprogramer@gmail.com wrote:[color=blue]
>
> How to build up a good frame for a mathematical system
> and it's ultra-high-speed?[/color]

Use the Mathematica approach; write an executable kernel
and a Web API...

Cheers,
NC

Henk Verhoeven
Guest
 
Posts: n/a
#5: Jul 17 '05

re: framework & speed


chiefprogramer@gmail.com wrote:[color=blue]
> "f();" cost 1148 ns
> "fffffffffff();" cost 1273 ns (1 function char cost 13 ns)[/color]

Hey! That example rather measures the speed of the parser. Do you really
think that if you run 10 times through the same code that php will be so
stupid to parse it 10 times? Go bussin!

Jerry Stuckle wrote:
[color=blue]
> If speed is your primary concern, don't use an interpretive language
> like PHP.[/color]

There are several optimizers for php. I believe Zend has one with a JIT
compiler. I remember reading an article on JIT compilers with Java that
explained that to get the slightly better performance with C++ for real
life applications they needed quite some compiler tuning. With common
compile options the JITters automatic dynamic optimizations beated C++
by a streatlength. Now those Java people say that Java can be better
optimized then weakly typed languages like php, but i have seen JITted
Smalltalk code run just as fast. I guess it is really a matter of what
your application should do, how much time you can spend on building it
and how much time you can spend (i.e. have left) on optimizing it.

If there is a lot of abstraction and logic, OOP is often a good choice.
With one of those large cluster servers that are nowadays available
php's lack of (native) multithreading is probably more of an argument
then its raw execution speed.

Greetings,

Henk Verhoeven,
www.metaclass.nl.
Closed Thread