SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is JSP really slower than php/asp/asp.net?

    I see a lot of comments that JSP/Java is slow compared to asp/php/asp.net is this true, because I have been on JSP sites like vodaphone or barclaycard and they don't seem any slower than other sites. Also I occasionally see a comment on here which states that jsp is in fact quicker does anyone have a definitive answer?

  2. #2
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, it's significatly slower, at least according to the benchmarks I've seen. It goes something like this:

    PHP 43 Pages per second
    ASP 42 Pages per second
    JSP 13 pages per second

    I posted the link in a recent thread about PHP vs. ASP I think. If you look around you may be able to find it. The reason you don't notice any speed difference is that just 13 pages per second is an AWFUL lot. (edit: It's 33 million pageviews per month) Most sites won't reach that.
    Last edited by M. Johansson; Apr 10, 2002 at 03:51.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  3. #3
    SitePoint Addict
    Join Date
    Nov 2000
    Location
    London, UK
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all, a disclaimer: I am in love with all things Java.

    I think you will find, though, that if you have a properly tuned server (and are using a fast JSP engine, like Resin), and your code is properly optimised, then the difference between PHP and JSP is quite small. I will admit , though, that optimising a JSP script is somewhat difficult, because, for example, you have to make sure that you are using the fastest database drivers, and there are several different ways of doing each thing, instead of one. Whereas in PHP, it's mostly just inbuilt functions.

    I imagine those tests were done with a "hello, world" script, and they counted the initial compilation time of the JSp into their average. Any self-respecting JSP programmer would have pre-compiled his jsp...

    Anyway, JSP isn't that much slower than anyone else, and don't let those benchmarks fool you: it's still the best.

    ... what's the world coming to?

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2002
    Location
    Rochester, NY
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    going based purely on personal experience, JSP is much slower... I don't ever recall visiting a *.jsp page without it taking quite a long time to execute :-|

  5. #5
    SitePoint Guru marcel's Avatar
    Join Date
    Nov 2000
    Posts
    920
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RE: FatPiper

    Anyway, JSP isn't that much slower than anyone else, and don't let those benchmarks fool you: it's still the best.
    I don't want to burst your bubble... But just saying that JSP is the best won't make it.

  6. #6
    SitePoint Addict
    Join Date
    Nov 2000
    Location
    London, UK
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I take it that means you didn't read the rest of my post?

    ... what's the world coming to?

  7. #7
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, I have seen very conflicting statements here. Fatpiper, while you seem very knowledgable and trustworthy, I'm trusting benchmarks more than one mans opinion. The benchmarks I'm talking about did take precompilation into account, if I remember correctly.

    Also, I just now noticed that the subject also included the question on whether ASP.NET is faster than JSP, and about that, there is no argument.

    Take a look at this article at Gotdotnet.com. It implements the Pet store application released by Sun as a best-practices blueprint application for java, using C# and .NET, and they concluded that it was 28 times faster, and implemented in 1/4 of the code. Even IF we assume a HUGE bias and an incredible amount of lies, it's still very impressive.
    Last edited by M. Johansson; Apr 10, 2002 at 16:12.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  8. #8
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by M. Johansson
    Also, I just now noticed that the subject also included the question on whether ASP.NET is faster than JSP, and about that, there is no argument.

    Take a look at this article at Gotdotnet.com. It implements the Pet store application released by Sun as a best-practices blueprint application for java, using C# and .NET, and they concluded that it was 28 times faster, and implemented in 1/4 of the code. Even IF we assume a HUGE bias and an incredible amount of lies, it's still very impressive.
    I have seen this comparsion too, although I believe .net to be quicker the difference is nowhere near what this test makes out. If you study the code you will see that the .net version is totally geared to performance optimisation, where as the java code was actually designed as a learning example and is geared towards portabilty and hardly optimised at all.

    For example the .net is optimised for sql server thus it only uses the minimum code for that, plus makes use of stored procedures. The java is set up so it can be used on any database, thus more code slower performance and does not use stored procedures for the same reason, again affecting performance. Basically the java pet store would be much, much quicker than it currently is if was optimised for one database like the .net code and made use of EJBS or the Apache Struts framework rather than normal beans/servlets. Saying that I still think .nets quicker, but by nowhere near the amount stated in that article.

  9. #9
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For me JSP is terribly slow. I am pro SUN and JAVA and all but its simply much slower than PHP and even ASP. Every page Ive seen written in JSP takes a lot longer to process. I dont think its comparably as fast as PHP.

  10. #10
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is pretty hard to quantify on the client end of an Internet connection though.
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark

  11. #11
    SitePoint Zealot
    Join Date
    Nov 2000
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That bench mark was done on jsp that wasn't compiled. The first time you load a jsp app, it will take longer to load. After that it should be quit a bit faster then 13 pages per load.

  12. #12
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my experience with JSP pages are that they're noticeably slower than PHP, ASP, ColdFusion pages in general... but i've read that JSP pages are slower the first time they're run as they need to be compiled, and also when any changes are made to the source code... if as lfabbric says, the JSP pages were run for the first time, then it probably isn't really fair... AFAIK, JSP pages which have already been accessed and compiles run very fast... that's some justification for Sun's claims about JSP's speed...

    well anyway, i'll be doing a project with JSP very soon at work and i'll see how it goes... i've to admit though that JSP is a much harder language to code in than PHP or ColdFusion but that's for another discussion

  13. #13
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    In my experience, the speed of optimised applications running in their ideal environment goes something like: .NET, PHP, ASP, CFM, JSP.

    As was pointed out before though, even the speed differences are really minimal, most users would hardly notice unless the code was unoptimised or was not running in the ideal environment.

    I was just talking to a CFM junkie the other day and he started in about how CFM is just as fast if you run it optimised and I just looked at him and asked him if he thought I wrote all my ASP and .NET stuff unoptimised. Every coder should be running stuff optimised, and most serious benchmarks do this.

    JSP isn't an inferior language by any stretch. It's not my language of choice, and I wouldn't recommend it to the people I'm working with, but that doesn't mean it can't pull it's weight. I've seen some incredibly fast JSP sites, just like I've seen some insanely slow PHP sites. There are simply too many variables to say "this language is best" or "this language is worst".
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  14. #14
    SitePoint Enthusiast kennyisnotdead's Avatar
    Join Date
    Apr 2002
    Location
    Massachusetts
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Two thoughts on the matter :

    • From what I've seen developers who use Perl, CGI, mostly go to PHP. Visual Basic developers go with Microsoft. Java programmers goto J2EE. The point being if you know VB you don't need to learn Java to develop applications.
    • Any Professional JSP developer would Pre-Compile his scripts. So you wouldn't have such lagg at first.

  15. #15
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by kennyisnotdead
    • From what I've seen developers who use Perl, CGI, mostly go to PHP. Visual Basic developers go with Microsoft. Java programmers goto J2EE. The point being if you know VB you don't need to learn Java to develop applications.
    • Any Professional JSP developer would Pre-Compile his scripts. So you wouldn't have such lagg at first.
    i do agree with you on both points, esp. the first... most people move on to a language whose syntax and structure are familiar to them or similar to languages they already know... but i'm stating the obvious ... still, sometimes you do not have a choice as to what language you have to use, especially at work where there're particular languages the company only uses as a standard policy-like thing...

    as for pre-compiling, yes a 'Professional' developer would... but sometimes you just forget to especially when you're only making minor changes to the source code... not to mention pre-compiling is a chore too...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •