Button Question for php

C++, C#, Java, PHP, ect...
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Button Question for php

Post by Jackolantern »

hallsofvallhalla wrote:
Falken wrote:Wouldn't it be posisble to calculate the whole fight first in the php, then just let a javascript present it nicely?

Would save alot of power.
that is actually the way I do it Falken. I need to get my first video of my javascript tutorials out.


@Jack
I wouldn't think so. At least not enough to affect anything. Depending how you run your battle the functions would use less because they can be run at anytime and a loop would have to be written over and over. I am not going to lie, I really don't know the answer to that but I would assume it wouldn't be enough to even see or feel the difference.
I can't say for sure for PHP since it is interpreted, but with compiled languages a function call uses up quite a bit more resources than pretty much anything you do inline (plus, computers handle looping no problem at all). It is not noticeable until you get into doing hundreds or thousands within very short periods of time, but if this does hold true in PHP, it is better to do these small optimization tasks up front rather than when problems crop up.
The indelible lord of tl;dr
Post Reply

Return to “Coding”