Php performance vs ASP.Net Performance

Last post 11-25-2006 5:49 AM by ShunTrevor1985. 157 replies.

Sort Posts:

  • Php performance vs ASP.Net Performance

    06-17-2002, 7:49 AM
    Locked
    • Member
      30 point Member
    • pr0c
    • Member since 06-14-2002, 3:32 PM
    • Michigan
    • Posts 6
    I'm trying to convince some people that asp.net is a better way to go. Is there any documentation around that compares the performance of the two? I've searched quite a bit and can't seam to find any.

    Thanks for any responses.

    Nate
    -Nate

  • Re: Php performance vs ASP.Net Performance

    09-06-2002, 12:01 AM
    actually to tell you the truth, PHP is much faster than ASP.NET, the reason being that PHP interprets all of its code inside of the PHP program itself, and since it is not accessing any other outside sources like COM objects, etc. It can produce a page in about 1/8 the time as a ASP.NET page can. Also the Database communication between MySQL is much faster in PHP, overall PHP has way better performance than any language, however, it all depends on your preference in language and the efficiency of your code.

    -Geoff
  • Re: Php performance vs ASP.Net Performance

    09-06-2002, 6:58 AM
    • Member
      460 point Member
    • interscape
    • Member since 06-27-2002, 11:13 AM
    • Mesa, AZ
    • Posts 92
    PHP is still a script language, and ASP.NET is an object-oriented, compiled language. You can't make PHP work in a windows app, but you can take ASP.NET code and drop it into a WinForms program without a whole lot of modification. If you want to talk all time performance, then maybe PHP is better, but I'll take OOP for the web over step-thru scripting any day of the week.
  • Re: Php performance vs ASP.Net Performance

    09-12-2002, 10:37 AM
    • Member
      80 point Member
    • ttuttle
    • Member since 09-12-2002, 9:44 AM
    • Posts 16
    I may be wrong, but I don't know of any credible organizations that have done performance testing of the two platforms. I would be wary of posts that say PHP "can produce a page in about 1/8 the time as a ASP.NET page can". Where does this information come from?

    I think a little more research is in order given this explaination:
    "PHP interprets all of its code inside of the PHP program itself, and since it is not accessing any other outside sources like COM objects."

    ASP.NET does have the backward-compatibility to use COM, but does not use it in normal page processing. That statement may have been true for ASP 3.0, but it is not applicable to ASP.NET.

    I'm not going to make any outrageous claims, but lets look at a few facts:

    --PHP has been shown to be slightly faster than ASP 3.0.
    --ASP.NET is 3 to 5 times faster than ASP 3.0 (an interpreted script like PHP).
    --ASP.NET can use built-in "Output Caching". After the page is first accessed and compiled, it can be served from cache. No page processor is faster than cache.
    --In default installations, ASP.NET is compiled, PHP and ASP 3.0 are interpreted.

    Now knowing that, take your best guess at which platform is faster....

  • Re: Php performance vs ASP.Net Performance

    09-13-2002, 11:05 AM
    • Member
      67 point Member
    • hardywang
    • Member since 06-19-2002, 8:34 AM
    • Toronto, Ontario, Canada
    • Posts 37
    Hi, can you tell me where is this data from?

    --ASP.NET is 3 to 5 times faster than ASP 3.0 (an interpreted script like PHP).

    If possible, can you provide me some URL for this resource?
    http://hardywang.spaces.live.com/
    Hardy
  • Re: Php performance vs ASP.Net Performance

    09-13-2002, 12:09 PM
    • Member
      80 point Member
    • ttuttle
    • Member since 09-12-2002, 9:44 AM
    • Posts 16
    Sure, it is right here at www.asp.net (http://www.asp.net/whitepaper/whyaspnet.aspx).

  • Re: Php performance vs ASP.Net Performance

    09-14-2002, 4:12 AM
    • Member
      43 point Member
    • fchateau
    • Member since 06-19-2002, 5:04 AM
    • US - Nashville, TN
    • Posts 24
    You may want to take a look at this little bit of anecdotal evidence relating to HTTP communications and Web Services.

    http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=49575
    Regards,

    Fred Chateau
  • Re: Php performance vs ASP.Net Performance

    09-14-2002, 11:59 AM
    • Star
      14,393 point Star
    • ScottGu
    • Member since 06-05-2002, 8:36 PM
    • Redmond, WA
    • Posts 2,004
    • AspNetTeam
      Moderator
    Note that ASP.NET is compiled rather than interpretted (which both PHP and classic ASP are). This can translate into much faster performance execution times -- since ultimately native instruction code ends up executing on each request.

    Someone earlier made some statement about interpreting being faster -- that is definitely not the case. Zend sells a PHP compiler add-on -- although it costs money (they definitely wouldn't be selling such a thing if compilation was slower <g>).

    In general performance can be a hard thing to measure -- because it often differs dramatically depending on what scenario, code and data access you do, so I always recomend taking perf benchmark claims with a grain of salt.

    However, we have seen with the Nile benchmark that ASP.NET with SQL is 2-3 times faster than PHP with MySql and almost 5 times faster than PHP with Oracle (even when the commercial Zend accelerator/cacher is installed).

    As with all performance tests, your experience with other scenarios could of course vary (on some ASP.NET might be even faster -- others the difference might not be as big).

    Hope this helps,

    Scott
  • Re: Php performance vs ASP.Net Performance

    09-15-2002, 12:52 PM
    • Member
      80 point Member
    • ttuttle
    • Member since 09-12-2002, 9:44 AM
    • Posts 16
    >However, we have seen with the Nile benchmark that ASP.NET with SQL is 2-3 times faster >than PHP with MySql and almost 5 times faster than PHP with Oracle (even when the >commercial Zend accelerator/cacher is installed).

    Thanks for the clarification Scott. Can you reference this Nile benchmark for the forum readers? Is there a website with these results and explainations of the testing? And who is Nile? Thanks.

    Troy

  • Re: Php performance vs ASP.Net Performance

    09-17-2002, 9:50 PM
    • Participant
      1,652 point Participant
    • wysiwyg
    • Member since 08-26-2002, 5:26 PM
    • Posts 357
    I know the topic is Php and Asp.net, but I cant help writing the following in response to some comments about asp.net faster than asp.

    I havent read many articles about speed comparison between classic asp and asp.net. All I am comparing is my classic asp and asp.net pages that do exactly the same thing. Classic asp is faster, MUCH faster.

    I really wish i can say the opposite. I cross my fingers, pray to god hoping this new page will be faster.... hasnt happened.

    I am new to .net so I could be doing my coding the ineffective way. Just need to figure out how to learn the proper way. In conclusion, I havent been able to prove to myself asp.net is the solution for slow performance.
  • Re: Php performance vs ASP.Net Performance

    09-19-2002, 8:39 PM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 3:24 PM
    • Plano, TX
    • Posts 1,181
    >Classic asp is faster, MUCH faster.


    I'd like to see the test results that show that, and the procedures that you used to test. I'm willing to bet that if you run a decent stress test, you find that you're inital reaction may not be spot on the mark.
  • Re: Php performance vs ASP.Net Performance

    09-19-2002, 9:43 PM
    • Participant
      1,652 point Participant
    • wysiwyg
    • Member since 08-26-2002, 5:26 PM
    • Posts 357
    The procedure is pretty simple. I load the classic asp page, I load the asp.net page, classic asp finished loading in 5 second. asp.net finished in more than 20. They both display the same data however, as you can guess, the way to achieve that same result is different.

    Just as an example, this is not the actual code but similar to one of the pages I am working on. The goal is to join 2 recordsets/datatable.

    In asp, this block of code takes 2 seconds:
    ..................
    ....store order info in myRS.....
    ....store customer info in myTable.....
    ...................
    Do while not myRS.eof
    myTable.open "select customername from tblCustomer where customerID=" & myRS.fields("CustomerID"), myConnection
    myArray(0,ubound(myArray,2))=myRS.fields("Ordernumber")
    myArray(1,Ubound(myArray,2))=myRS.fields("OrderDate")
    myArray(2,Ubound(myArray,2))=myTable.fields("CustomerName")
    myTable.close
    myRS.movenext
    loop

    In asp.net, this block of code takes over 40 seconds:
    trace.warn("open conn: " & now)
    ..................
    ....store order info in datatable myDataTable.....
    ....store customer info in datatable myCustomer.....
    ...................
    myDataView=new DataView(myCustomer)
    for each myRow in myDataTable.rows
    myDataview.rowFilter="CustomerID=" & myRow("CustomerID")
    myRow("CustomerName")=myDataview(0).row("Customername")
    next
    trace.warn("finish looping: " & now)

    FYI, heres the trace info:
    open conn: 9/19/2002 4:24:02 PM 0.145755 0.113731
    finish looping: 9/19/2002 4:24:45 PM 42.584835 33.638436

    So why? My statement about their performance is solely based on comparing pages I have written in asp and asp.net. Again I am new to .net, possibly I am not coding it the right way but I assure you I have tried looking for other ways. If I use a datareader instead of dataview, request timed out. I tried using command.executescalar but the customername always comes out null. If you do see what I am doing wrong, please tell me what it is. =)
  • Re: Php performance vs ASP.Net Performance

    09-19-2002, 10:17 PM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 3:24 PM
    • Plano, TX
    • Posts 1,181
    In my improptu tests, using ACT as the measure, on a slow machine, I can get 10-15 pages (hitting a SQL Server DB, and displaying a record) served per second using classic ASP. The same function, using ASP.Net, and I jump to 30-40 pages served per second. Using ASP.Net and output caching, it increases yet again to 80-120 pages served per second, when cached.

    Again....Forget what you see when you load the page into the browser. Run a good stress test on it. That will tell you what the real preformance difference looks like.
  • Re: Php performance vs ASP.Net Performance

    09-20-2002, 12:15 AM
    • Participant
      1,652 point Participant
    • wysiwyg
    • Member since 08-26-2002, 5:26 PM
    • Posts 357
    I am not saying I dont believe you. And as a matter of fact your figures are very impressive and make me really wonder what it is that i am missing.... =(

    Can you suggest what exactly to do to run a good stress test? Not that I understand how its gonna make a difference. To me, what I want to test is what our customers are going to see. Thats why my performance test is that simple, just compare the loading time between what they are using now and what i plan to have them used later.

    Thanks for the post, I hope I can get somewhere with .net.......
  • Re: Php performance vs ASP.Net Performance

    09-20-2002, 5:38 AM
    • Contributor
      5,962 point Contributor
    • Xanderno
    • Member since 06-17-2002, 3:24 PM
    • Plano, TX
    • Posts 1,181
    MS provides a couple of stress tools. ACT comes with the VS Enterprise versions...If you don't have one of those, WAST is still available as well. WAST website

    Really, I want to assure you, loading a page on a development box into your browser for a look is not going to be very indicative of what your users are going to see.

    Next...Remember to use output caching! When you can and do use it, it'll make your pages perform ridiculously well. More on the order of HTML pages. It's a brilliant tool that ASP.Net provides for us...But that you wouldn't see by loading the page into your browser once. Try loading it five times. Or stress testing it, as I have suggested. You'll see the difference then. It's well worth it.
Page 1 of 11 (158 items) 1 2 3 4 5 Next > ... Last »