[web] Which one is more efficient? JSP or PHP

Started by
19 comments, last by chollida1 17 years, 9 months ago
I will start coding a web based game in a few days. I am not sure with which one should I code it? But I am more tended to JSP. I want your comments on this please.
Advertisement
The one that will be the most efficient is the one your the most familar with. Your productivity will be much higher in the long run going with the one you know best. However, you may miss an exciting oppurtunity to learning something new and challenging!

http://shootout.alioth.debian.org/debian/benchmark.php?test=all〈=java&lang2=php

In these tests PHP seems to be more efficient with memory, but Java is mostly faster.

I've never used JSP so I dont know how sutable it is. PHP is very easy to learn/use, but I would just use whatever you are more familliar with.
Sorry, the forum messed up the link...

http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lang=java&lang2=php
Don't worry about which one is more efficient. Worry about which language you are more proficient in.

Also, the first thing to affect efficiency is going to be how you design your database and how you access it. Yes, the language/framework powering your application will affect speed, but usually far less than the code you write yourself.
The more efficient one is, as others have noted, the one which you are more proficient in, because you will be able to build the application more quickly (which is more important than runtime performance).

I'm sure Java will outperform PHP in every task at runtime, but you really don't care!

Mark

PS: Please don't use JSP, it really sucks. It is an abuse of the Java VM :)
I have used JSP and i hated every bit of it.

Dave
I am good on both languages. But the main performance problem is with the database queries. In java I made a design plan about database queries. I will form a class file for each database table in which there will be methods get_field and set_field for each field and a method update_record to set all fields to new positions. By this way I am thinking of minimizing the database query number to minimum. Is this a good idea?
For best performance you will want a layer that gives you direct SQL access to the database, and performance will then be dependent on your database, database structure, and SQL quality, rather than the web language. Both languages should be able to offer this.
Quote:Original post by mfk_1868
By this way I am thinking of minimizing the database query number to minimum. Is this a good idea?

Yep, that's pretty much rule #1 in database queries. Don't use two queries if you can manage with one. Crossing the boundary from your external application to the database is expensive, so use as few queries as possible.

This topic is closed to new replies.

Advertisement