Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP or JSP for intensive processing

Status
Not open for further replies.

euskadi

Programmer
Oct 4, 2001
179
US
I'm planning on building an application that does some problem solving using an iterative process to determine the best solution -- it will use some arrays, do an occasional write/read on a database, and then when all avenues are exhasted it will write the final result to the database and say "I'm done!". There could be a few hundred iterations in this, with database hits every 100 iterations or so.

My db is MySQL, I can use JSP (Tomcat) or PHP.

So, with that vague description, can anyone tell me if PHP offers any advantages over JSP? I'm looking for:
1) Stability - if I can help it, I don't want to cake the server
2) Speed
3) Ease of programming. I'm coming from a VB background and don't know enough yet about JSP & PHP to know if there's a big difference that would point me in one direction.

<note: I know I'm probably insane to even think to build something like this... please help me pick my poison>

Thanks!!
 
hi,
1) Stability - i have worked on a lot of pages in PHP and it is quite stable. but so is JSP
2) Speed - PHP also has a good speed but JSP has a light advantage as all the code is already in parsed. but in PHP every time the page is loaded the PHP interpreter has to parse the code.
3) Ease of programming - Defenitely PHP, JSP simly drives u nuts when it comes to debugging a program.

and if u r from VB then PHP is the best as its range of functions is simply amazing. and if its MySql, then i advice PHP. it has all the inbuilt database functions that u would want.

and my personal opinion - PHP...

Known is handfull, Unknown is worldfull
 
If speed were the primary factor, I'd write it in C. Stability would then, of course, be a factor of how good my code is.

But PHP is plenty fast, so long as you are careful to take advantage of PHP's builtin functions as much as possible. If you use a builtin instead of writing your own interpreted code to accomplish the same thing, you're running compiled code. Of course, the same thing can be said of Java, too.

However, as vbkris has said, PHP has the advantage of speed of iterative debugging. There's no compilation step each time you change edit your code.

If speed is a question and you want to go with PHP and you have $295 to devote to the problem, Zend (the author and distributor of PHP) has a product called Zend Accelerator, which can convert your PHP code to an intermediate form like Java p-code.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
and there is a free one too (the compiler). do a search in this forum. skiflyer put us on to it...

Known is handfull, Unknown is worldfull
 
One more comment:
Be aware that the PHP setup must allow for the script to run for the required time. If you are hosting with a host that only allows for 30 seconds of time for the script you might want to use a different method or host.
 
Thanks to all who have posted so far -- stars for you all for taking the time to comment. As DRJ478 guessed, I'm using hosting, so I'm limited on what I can choose // it's PHP or JSP or nothing. I'll have to check my processing limit, thanks for the clue!!

Oh, and any solution which requires more than $0 is out -- my philosophy on this one is &quot;if it's not free, it's crap&quot;.

Right now I'm leaning toward building it in PHP. I'm finding as I do more research that the built-ins in PHP are nice, and converting to JSP won't be that hard if I decide to run side-by-side to get a final verdict.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top