# Fastest language?



## Callum_Dawson (Mar 9, 2009)

As I said in a previous post, I am trying to make a search engine for a cluster of websites, and the search engine software has the option to index the pages in either JavaScript, ASP, or PHP. Which would be the quickest language of the 3, so I can index pages quicker?


----------



## ehymel (Aug 12, 2007)

JavaScript will be run on the client side, so this doesn't make much sense. Whether ASP or PHP will depend on the capabilities of you server. The difference in speed is most likely dependent on the efficiency of the code more than the language chosen. I doubt you would notice much difference, but you could always build both (or all 3) ways and do some benchmark testing.


----------



## tomdkat (May 6, 2006)

ehymel said:


> JavaScript will be run on the client side, so this doesn't make much sense. Whether ASP or PHP will depend on the capabilities of you server. The difference in speed is most likely dependent on the efficiency of the code more than the language chosen. I doubt you would notice much difference, but you could always build both (or all 3) ways and do some benchmark testing.


:up:

Peace...


----------



## Fyzbo (Feb 6, 2002)

Will agree with benchmark testing, but currently PHP is faster than classic ASP. ASP has not had any updates since 2000 and Microsoft's focus has been on Asp.net.


----------



## tomdkat (May 6, 2006)

Fyzbo said:


> Will agree with benchmark testing, but currently PHP is faster than classic ASP. ASP has not had any updates since 2000 and Microsoft's focus has been on Asp.net.


Is this a function of the back-end engine which processes the script?

Peace...


----------



## MMJ (Oct 15, 2006)

Neither ASP nor ASP.NET are languages.

@OP: Use PHP, not the best solution overall but for your capabilities at the moment it probably is.


----------



## tomdkat (May 6, 2006)

MMJ said:


> Neither ASP nor ASP.NET are languages.


Ok, how does the performance of the PHP engine (Zend) compare to ASP.NET?

Peace...


----------



## Fyzbo (Feb 6, 2002)

This is the only real tests I've seen: http://misfitgeek.com/blog/aspnet/p...s-versus-linux-ndash-who-rsquo-s-the-fastest/


----------



## Fyzbo (Feb 6, 2002)

At the end of the day though, the efficiency of the code and the power of the server will make more of an impact than what framework is used.


----------



## tomdkat (May 6, 2006)

Fyzbo said:


> This is the only real tests I've seen: http://misfitgeek.com/blog/aspnet/p...s-versus-linux-ndash-who-rsquo-s-the-fastest/


Thanks for the link.



Fyzbo said:


> At the end of the day though, the efficiency of the code and the power of the server will make more of an impact than what framework is used.


I think this is more applicable when talking about compiled languages than interpreted. I understand poorly written code will run poorly in any environment but the speed, "intelligence", and ability to optimize well written code is the function of the interpreter (in a scripting environment) or the compiler (in a compiled language environment) will definitely impact the performance of running the code. Improvements in the "engine" that interprets or "runs" the code (including JIT environments) will result in that same code running faster or more efficiently.

Peace...


----------



## MMJ (Oct 15, 2006)

tomdkat said:


> Ok, how does the performance of the PHP engine (Zend) compare to ASP.NET?
> 
> Peace...


C# is definitely a faster language then PHP, its speed is rather close to C++.

However most ASP.NET applications have way more overhead then a similar PHP application. I personally would never use ASP.NET in a small or large project. IMO it's a stupid language and stupid framework.


----------



## tomdkat (May 6, 2006)

MMJ said:


> C# is definitely a faster language then PHP, its speed is rather close to C++.


Is C# compiled or interpreted or can it be either? Also, does anyone know how well the PHP CLI performs compares to the web server module?



> However most ASP.NET applications have way more overhead then a similar PHP application. I personally would never use ASP.NET in a small or large project. IMO it's a stupid language and stupid framework.


LOL What do you consider "stupid" about it?

Peace...


----------



## MMJ (Oct 15, 2006)

C# isn't compiled straight to byte-code, no.

It's the main language/framework we use at work. It's just stupid for web development.


----------



## Fyzbo (Feb 6, 2002)

C#, VB.net, J#, C++/CLI, etc are all compiled into the Common Language Infrastructure (CLI). Although it's not byte code it is much faster than interpreted languages like PHP and Classic ASP. It's much the same way Java works. The CLI code can then be run on the .net runtime or mono for linux.

I don't know how C#.net language or the .net framework could be considered "stupid" for web development as asp.net is geared specifically for that. There has been a lot of debate over webforms and how they try to maintain state through post backs, but that is only one component of asp.net and it's not necessary to use it. I work with asp.net daily and feel it's currently the best solution, especially as options grow. Asp.net MVC is now production ready and great for those who have RoR experience. Asp.net 4.0 made great strides on the html/css removing a lot of the extra code (overhead) and making it extremely Ajax friendly.

I'd like to know what solution is better than Asp.net paired with Visual Studio for building large enterprise applications and why? PHP, Java, Asp.net all have their pros and cons, but none seem stupid.


----------



## tomdkat (May 6, 2006)

Fyzbo said:


> C#, VB.net, J#, C++/CLI, etc are all compiled into the Common Language Infrastructure (CLI). Although it's not byte code it is much faster than interpreted languages like PHP and Classic ASP. It's much the same way Java works. The CLI code can then be run on the .net runtime or mono for linux.


I know you're responding to MMJ but I wanted to clarify my reference to the "PHP CLI" as the "PHP Command Line Interface (CLI)". 



> I don't know how C#.net language or the .net framework could be considered "stupid" for web development as asp.net is geared specifically for that. There has been a lot of debate over webforms and how they try to maintain state through post backs, but that is only one component of asp.net and it's not necessary to use it. I work with asp.net daily and feel it's currently the best solution, especially as options grow. Asp.net MVC is now production ready and great for those who have RoR experience. Asp.net 4.0 made great strides on the html/css removing a lot of the extra code (overhead) and making it extremely Ajax friendly.
> 
> I'd like to know what solution is better than Asp.net paired with Visual Studio for building large enterprise applications and why? PHP, Java, Asp.net all have their pros and cons, but none seem stupid.


*Not* being an ASP.NET developer, I would say the main "con" to an ASP.NET platform is the Windows requirement. I have heard of ASP.NET "solutions" for non-Windows platforms but from what little I understand, ASP.NET runs best on Windows systems. In cases of PHP and server-side Java, those tend to be platform independent (for the most part). Another way of looking at that statement is PHP and server-side Java environments can be found natively on many more platforms which provides more options for those needing those technologies on the back end. On a side note, I have always questioned referring to PHP and Java (JSP) together since one is a scripting language where the other is not.

Visual Studio is another "Windows lock-in" which further restricts development options. Not every large business wants Windows everywhere.

Peace...


----------



## MMJ (Oct 15, 2006)

Microsoft likes to dumb down everything. Stop trying to bridge the developmental process between desktop and web applications.

C# is an extremely tedious language. Writing in a language with such a low LOC efficiency (check for dbnull values, check for values that check for dbnull, etc) and writing in a language like Python - which has one of the highest LOC efficiency can't be compared.

Also IIS is a crappy-as-hell webserver, no one debates that issue.


----------



## JimmySeal (Sep 25, 2007)

Fyzbo said:


> C#, VB.net, J#, C++/CLI, etc are all compiled into the Common Language Infrastructure (CLI). Although it's not byte code it is much faster than interpreted languages like PHP and Classic ASP.


CIL is bytecode:



http://en.wikipedia.org/wiki/Common_Intermediate_Language said:


> Due to standardization of C# and the Common Language Infrastructure, *the bytecode is now officially known as CIL*.


I think you meant to say that it's not machine language.



MMJ said:


> C# isn't compiled straight to byte-code, no.


Looks like you have the same misunderstanding, unless _I'm_ missing something here.


----------



## MMJ (Oct 15, 2006)

JimmySeal said:


> Looks like you have the same misunderstanding, unless _I'm_ missing something here.


Meh. Meant machine code, typed out byte code. Don't think I realized that that terminology was incorrect.


----------



## Fyzbo (Feb 6, 2002)

MMJ said:


> Microsoft likes to dumb down everything. Stop trying to bridge the developmental process between desktop and web applications.


 It's called Rapid Application Development (RAD), not dumbing things down. When a companies programmer can create applications, or websites, faster and more efficiently because of smarter tools companies benefit. You sound like one of the people who railed against IDEs and WYSIWYG editors because all code should be written in notepad.



MMJ said:


> C# is an extremely tedious language. Writing in a language with such a low LOC efficiency (check for dbnull values, check for values that check for dbnull, etc) and writing in a language like Python - which has one of the highest LOC efficiency can't be compared.


 I've never seen LOC used as the most important aspect of a language. I guess everyone has their priorities. Me I'm more concerned with building a great app, anything that gets it done faster or easier is a plus.



MMJ said:


> Also IIS is a crappy-as-hell webserver, no one debates that issue.


I'm debating it. If it was "crappy-as-hell" no one would use it, but that is not the case. Every webserver has pros and cons and I won't try to guess which is the best, but IIS is definitely near the top of the list.


----------



## JimmySeal (Sep 25, 2007)

I think C# is a great language. It's far more developer friendly than C or C++, and still considerably more intuitive than Java.

I'm curious to hear what makes C# so "stupid" besides the degree of LOC efficiency, but we're getting off topic. Hopefully OP's question has been satisfactorily answered by now.


----------



## MMJ (Oct 15, 2006)

My bad, I meant stupid for web development. The language alternatives for web development are far superior.



JimmySeal said:


> It's far more developer friendly than C or C++, and still considerably more intuitive than Java.


While I did very little C and no C++ or Java, I agree with this statement.


----------



## tomdkat (May 6, 2006)

Fyzbo said:


> It's called Rapid Application Development (RAD), not dumbing things down. When a companies programmer can create applications, or websites, faster and more efficiently because of smarter tools companies benefit. You sound like one of the people who railed against IDEs and WYSIWYG editors because all code should be written in notepad.


I think it's really a mixed bag. One can use an IDE and not use RAD features/functions. I haven't used many RAD tools but currently I use VisualStudio .Net 2003 to work on two different Windows apps the company I work for developed and based on that work I can easily see how relying too much on a tool can be a bad thing. These Windows apps use MFC and there are too many macros and other things intended to "help" the developer that I find get in the way. Unfortunately, these apps were developed before I was involved so the current use of MFC is greatly entrenched.

I also do development outside of the IDE so I get a mixture of the "magic" MFC offers and the "raw code" I deal with for the non-Windows products I also work on. It's true that a good RAD tool can speed up the development process but I think it can also shield the developer from the underlying code to the point where poor programming practices can develop mostly because the developer doesn't have a frame of reference of what "good" programming practices are.

I've been fortunate in that I've been effectively "trained" by some great programmers so my perspective is a little different. I've been exposed to C, C++, Java (1.1 and some 2 (Swing)), and some scripting languages on Windows, Unix, and mainframe platforms and I do work in various combinations of those languages and platforms daily. The web stuff I do is just on the side. 



> I've never seen LOC used as the most important aspect of a language.


I think I'm in this camp since I view SLOC (I'm old school ) as relating to design, more than anything. A poor design/architecture can result in writing far much more code than could or should be required.



> I'm debating it. If it was "crappy-as-hell" no one would use it, but that is not the case. Every webserver has pros and cons and I won't try to guess which is the best, but IIS is definitely near the top of the list.


It's clear Apache has won the web server race/contest but I don't think it's a great server. I've configured older versions of IIS on our LAN in support of a web application we were prototyping and found it to be a great PITA. However, IIS rocks if you're using Microsoft technologies on the back end and like operating with an all or mostly Microsoft solution.

Peace...


----------



## Fyzbo (Feb 6, 2002)

tomdkat said:


> I think it's really a mixed bag. One can use an IDE and not use RAD features/functions. I haven't used many RAD tools but currently I use VisualStudio .Net 2003 to work on two different Windows apps the company I work for developed and based on that work I can easily see how relying too much on a tool can be a bad thing. These Windows apps use MFC and there are too many macros and other things intended to "help" the developer that I find get in the way. Unfortunately, these apps were developed before I was involved so the current use of MFC is greatly entrenched.
> 
> I also do development outside of the IDE so I get a mixture of the "magic" MFC offers and the "raw code" I deal with for the non-Windows products I also work on. It's true that a good RAD tool can speed up the development process but I think it can also shield the developer from the underlying code to the point where poor programming practices can develop mostly because the developer doesn't have a frame of reference of what "good" programming practices are.


That argument has been made every time there are advancements in programming. C was going to make bad programmers as you learned a lot more about memory allocation and what's truly going on with assembly. Then Java was going to make bad programmers as it did too much for them. In the end, it seems like there are good programmers and bad programmers regardless of the language or tools used. I've seen plenty of lousy .net code, but I've dealt with more lousy javascript code.



tomdkat said:


> I've been fortunate in that I've been effectively "trained" by some great programmers so my perspective is a little different. I've been exposed to C, C++, Java (1.1 and some 2 (Swing)), and some scripting languages on Windows, Unix, and mainframe platforms and I do work in various combinations of those languages and platforms daily. The web stuff I do is just on the side.
> 
> I think I'm in this camp since I view SLOC (I'm old school ) as relating to design, more than anything. A poor design/architecture can result in writing far much more code than could or should be required.
> 
> ...


Apache is more widely used, however I wouldn't say it's won.










In the enterprise space it seems pretty even, for smaller or personal websites people seem to choose apache. I'm guessing this is because of the low cost and smaller learning curve for PHP as well as the tons of great open source languages written in PHP.

I've said before, I don't think one is better then the other, it all depends what you are trying to accomplish.


----------



## tomdkat (May 6, 2006)

Sorry for the delay. I've been sick for the last several days. 



Fyzbo said:


> That argument has been made every time there are advancements in programming. C was going to make bad programmers as you learned a lot more about memory allocation and what's truly going on with assembly. Then Java was going to make bad programmers as it did too much for them. In the end, it seems like there are good programmers and bad programmers regardless of the language or tools used. I've seen plenty of lousy .net code, but I've dealt with more lousy javascript code.


The thing is, a RAD isn't an "advancement in programming", IMO. Sure it could be a great programming *tool* by doing the things you mentioned previously (allowing developers to develop apps faster and possibly more efficiently). I have heard it argued whether C was a high-level language or not but not that is was "bad" because it exposed (or could expose) you to more low-level things. Java brought some great object-oriented concepts to the table (especially if you were a C++ programmer but not necessarily if you had experience with other object-oriented languages/systems) and addressed the pointer issues known to plague C/C++ developers who didn't manage them properly. I don't know if that's "doing too much" but those things are quite different, to me, than a tool designed to do as much of the "work" for you as possible so you won't have to exposed to the "nitty gritty" as much as in previous times.

As a result, programming knowledge can get lost. Or, maybe I'm just "old school" when it comes to this. 



> Apache is more widely used, however I wouldn't say it's won.
> 
> 
> 
> ...


That chart shows Apache has been the dominant web server since June-ish 1996. If that's not considered "winning" I don't know what is. 

In the enterprise space, I can see IIS being used because it's a MS product that goes along with the "MS Standardization" a lot of corporations practice. If MS produced a full security suite, corporations would dump McAfee or Symantec products and adopt the MS product, for example. The only pro of IIS, IMO, is its support of MS server-side technologies, like ASP. I don't know how well ASP is supported by Apache on Windows but I would imagine IIS kicks Apache's butt in this arena.

Peace...


----------



## lordsmurf (Apr 23, 2009)

Sometimes it comes down to how code is run. PHP for example, can be run as Apache, Isapi, Fast CGI, CGI, etc --- safe mode or not -- it's not just "PHP".

Apache is free and easy to install. That doesn't mean it's best. (Disclaimer: I do have Apache on one server.) You'll find businesses run a lot of different things: IBM, nginx, lighttpd, IIS6-7, etc. Most "big sites" don't actually use Apache. To add insult, a lot of IIS7 servers can outdo Linux for PHP speed.

IIS6 was pretty good, and IIS7 is great. The anti-MS stuff usually drags over from anti-MS desktop sentiments, rather than actual use of the server (proper knowledgeable use, not monkey-with-stick use).

Like anything else, these are just tools. I use the one I need. No emotional attachments.


----------



## tomdkat (May 6, 2006)

lordsmurf said:


> Sometimes it comes down to how code is run. PHP for example, can be run as Apache, Isapi, Fast CGI, CGI, etc --- safe mode or not -- it's not just "PHP".


I know the PHP developers recommend against running Zend in a muti-threaded Apache on Unix environment as an Apache DSO but instead via FastCGI. I would wonder how this would impact performance of Zend.



> Apache is free and easy to install. That doesn't mean it's best. (Disclaimer: I do have Apache on one server.) You'll find businesses run a lot of different things: IBM, nginx, lighttpd, IIS6-7, etc. Most "big sites" don't actually use Apache.


It's funny you mention IBM since their web server (which runs on their "big iron") is based on Apache.  Also, a lot of "big sites" have mixtures of server configurations so it can be challenging to find out which servers are "actually" serving content. Not to mention some using custom servers, and so on.



> To add insult, a lot of IIS7 servers can outdo Linux for PHP speed.


I'm not surprised for that since speed isn't Apache's primary goal. Also, how does IIS7 run PHP in Unix environments? Have you seen any performance tests comparing IIS7 on Windows to Apache on Solaris or AIX, etc? thttpd is known for speed but clearly isn't one of the more popular web servers out there.



> IIS6 was pretty good, and IIS7 is great. The anti-MS stuff usually drags over from anti-MS desktop sentiments, rather than actual use of the server (proper knowledgeable use, not monkey-with-stick use).


Yep, I agree. I've spent some time with IIS (IIS5.1 or 6, it's been so long now I forget) and found getting it to work for what we needed (primarily testing) was a huge PITA. I think if IIS were actually that good, MS would have more of the web server market space if IIS ran on platforms other than Windows.

Peace...


----------



## MMJ (Oct 15, 2006)

I wasn't talking about usage, I was talking about the quality of the software product itself. Apache is superior to IIS, but not necessarily better then lighttpd or nginx.


----------



## lordsmurf (Apr 23, 2009)

I performed some php tests on IIS6 vs IIS7 vs Solaris vs Linux Apache (I forget the version # -- whatever was newest in late 2006), back in mid 2008. IIS7 won. I did not expect that result, so I ran the tests twice. I ran the tests because of some articles at the time making the same claims. _Disclaimer: Same machine not used, but servers were all comparable. Tweaked for OS performance, too._

IIS5 blew, but IIS6 was really good once you started to add in 3rd-party plugins (for example: to run mod_rewrite with htaccess). IIS7 ran better, and it can be more Apache-like in features with 3rd-party plugins (again, htaccess is a big one).

We're only talking about web serving too -- databases is another ugly monster.

Most companies I work with have a Frankenstein of boxes. It's always such a mess. It gets even worse when they try to force incompatible systems to share functions or data. I can see why so many companies, IBM for example, like to push "use us for everything" (web, db, etc) marketing on their server offerings.



> Apache is superior to IIS


That's such a meaningless statement, though. Apache can't run everything, so it's not "superior" when you have a .NET site or need certain web apps. Apache is just a tool, use it when it meets the needs. Don't confuse others or delude yourself into thinking it's "best" by any means. Because IIS can run most everything Apache can, plus all the MS stuff, I could call IIS "superior". But we know that's not true either.



> quality of the software product


That's another really generic thing to ask about. How do you define _quality_? To some people, ease of use makes it _quality_. (Of course, now that I opened that can of worms, nothing is _quality_, because none of it is really what I'd call _easy_ to use!)

Professionals really need to avoid fanboyism. Anti-MS sentiment is never productive. If you're a pro and you have anti-MS attitude, you're not being fair to the client, as you may overlook a good MS-based option. These are just tools.


----------



## tomdkat (May 6, 2006)

lordsmurf said:


> I performed some php tests on IIS6 vs IIS7 vs Solaris vs Linux Apache (I forget the version # -- whatever was newest in late 2006), back in mid 2008. IIS7 won. I did not expect that result, so I ran the tests twice. I ran the tests because of some articles at the time making the same claims. _Disclaimer: Same machine not used, but servers were all comparable. Tweaked for OS performance, too._


That's cool. Do you know which version of Solaris you were testing and on which hardware platform (SPARC vs x86)? 2006 is pretty old for both Linux, PHP, and Apache. 

I would love to read more about the test you performed since the comments I'm finding online about the performance of running PHP in both we servers differs from your findings.  Of course, I'm not saying "they" are right and you're wrong but only that I would like to read more about the testing you conducted.



> IIS5 blew, but IIS6 was really good once you started to add in 3rd-party plugins (for example: to run mod_rewrite with htaccess). IIS7 ran better, and it can be more Apache-like in features with 3rd-party plugins (again, htaccess is a big one).


Thinking back now, I believe we were wanting to get mod_jk Connector working with Apache and IIS as part of a configuration test in support of a Servlet-based web app we were developing. Apache with mod_jk proved far more configurable than IIS (we were running this on Windows 2000 so it must have been IIS 5.1) and we couldn't get IIS configured in similar ways we got Apache configured. IIS5 might have sucked but it was the latest and greatest version available (back then) and we were running with Apache 2 on HP-UX, and Windows 2000 (I think). Man, my memory is getting bad. LOL

Peace...


----------



## lordsmurf (Apr 23, 2009)

Sadly, I don't have any of the data anymore. Long story, and I get pissed just thinking about it. I think it was SPARC -- it wasn't my machine. One of the things I did was installed a fat WordPress install full of plugins, and test page load times on the intranet -- lag was visible between them.


----------



## tomdkat (May 6, 2006)

Fooey, oh well. 

Peace...


----------



## MMJ (Oct 15, 2006)

Flamebait: IIS + Windows can't compare security-wise to 'nix + Apache.



lordsmurf said:


> Professionals really need to avoid fanboyism. Anti-MS sentiment is never productive. If you're a pro and you have anti-MS attitude, you're not being fair to the client, as you may overlook a good MS-based option. These are just tools.


Haha, I like how you're implying I'm an MS hater.


----------



## lordsmurf (Apr 23, 2009)

Server security is more about the admin, not the software in use.


----------



## tomdkat (May 6, 2006)

lordsmurf said:


> Server security is more about the admin, not the software in use.


Oh, I wholeheartedly disagree. Server security is about *both*, the admin _and_ the software in use. The admin needs the knowledge, patience, interest, and experience to lock down the server and configure the software in a secure fashion and the software needs to have tools and mechanisms to allow to be run securely (or as much as possible).

Bad admins can incorrectly configure a server but good software can minimize the negative impacts of that.

Poorly developed software can be rife with security holes but a good admin can block those holes as much as possible.

Peace...


----------

