Speed Comparison - Amazon Web Services

flutheronioneyedSoftware and s/w Development

Dec 13, 2013 (3 years and 5 months ago)

76 views

Speed Comparison

Asp.Net is an optimized and compiled
language, meaning
code you enter is reduced
to a set of machine
-
specific instructions
before being saved as an executable file.

Even if you do not explicitly compile your
code before you deploy it, it compiles the
first time it is run, then after that it runs as
compiled code

Php on the other hand is an interpreted
language, meaning it is saved as the code
your write and run direc
tly from that code. It
is widely accepted and proved many times
over that
Compiled programs generally run
faster than interpreted ones because
interpreted programs must be reduced to
machine in
structions at runtime
.


S
peed comparison
of Search
for a
small project:







As shown in the above chart:

the average time for the php site: 0.1500
seconds

the time for Asp.Net: 0.0150 seconds


Consider the speed comparison for a large
project:


Php
took an average of 1.0097 seconds

the Asp.Net run took 0.0810 seconds




ASP.NET (C#) operations, object use, library calls, etc. are SIGNIFICANTLY faster that the PHP equivalents.



I’ve always thought that if high end performance options were part of your
needs requirements,


then .NET programming has
some advanced options “out of the box” like multi
-
threading, asynchronous requests, and a number of caching options.



ASP.NET

PHP

Comments


Latest Stable
Version

4.0

5.3.3

As of 19 Aug 2010


License

MS
EULA

PHP License v3.01




Price



∙ ASP.NET
-

.NET
Framework is free. So
ASP.NET also free



∙ Web Server


IIS


Not
Free. OS cost applicable



∙ OS


Windows Server


Not Free







. PHP


Free

∙ Web Server


Free



∙ OS


Linux is
free,
Windows is costly

PHP can be installed on any
OS and Web server.

But ASP.NET is
recommended for IIS only
(even though ports to few
web servers available)


Third Party
Hosting Price

Cost involved



Cost Involved,



Although it claims to be
free, when
using free 3rd
party add
-
ons developers
often run into issues
when developing
commercially available
applications (i.e.
ownership of code /
intellectual rights)

Both are not costly but if you
compare, PHP is found little
bit cheaper


Development
Cost



Developer cost Involved



Visual Studio Express
Editions are free



Rapid
-
Application
-
Development Model. So
development takes less
time



Developer Cost Involved



Free/Open Source IDEs
available



Much coding involved

Both are same but ASP.NET
is more on Rapid
-
Appl
ication
-
Development and
PHP is more on Coding


Cross Platform

Yes

Yes

Whatever server side
language you use, browsers

render only as HTML.

But development is not
cross
-
platform even though
ASP.NET got ports for Linux
available

Code
Portability


Partial

Yes

For php, a code written on
Linux/Apache will work on
Windows or any OS/Web
Server.

But .NET, even though we
have ports available, you will
require some tweaks to
make it run


Cloud Feasibility

Possible

Possible

Additionally, for ASP.NET
-
SQL Azure
also available for
database hosting


Mode of source

Closed Source

Open Source

Application developers have
no benefits for either it is
closed or open

UPDATE:
Microsoft also
opened .NET framework code
for reference. Not that it is
just for reference. You
cannot do anything except
reading.

A real open source must be
able to download, make
amendments, re
-
compile.

You cannot make your own
.NET versions.


Promoted by

Microsoft

PHP Community




Customer
Support by
Owner

Yes

No




Security Fixes

Auto Update


part of OS

Need to update separately
Both parties release fixes for

when available

bugs and security issues
instantly

Developer Help

Community

Community

Both technologies got fans
worldwide. They will provide
help and guidance through
forums, mail lists
, news
groups etc.


Languages



∙ C#



∙ VB.NET



∙ Jscript etc.

PHP




Database

Any Database

Good fit: Microsoft SQL
Server

Any Database

Good fit: MySQL

Supports most of the
databases


Frameworks /
OOPs



∙ There is an inbuilt
framework (called web
forms framework) available
which will force developers
to use OOPs

You can write both
procedural and OOPs based
code




MVC

Microsoft ASP.NET MVC

Symfony




Development
IDE



∙ Recommended: Microsoft
Visual Studio



∙ Any
IDE



∙ Recommended: Zend
Studio



∙ Any IDE

Even notepad can be used
for coding. PHP is more easy
for that, but if you can afford
Visual Studio, then ASP.NET



Visual studio 2008 along
with ASP.NET provide a
strong IDE(Integrated
Development
Enviro
nment) for web
application development.
Visual studio maintains
markup and programming
files separately. It is easy
to manage code and
markup in two files



PHP uses only one file for
markup and programming
logic

ORM



∙ ADO.NET Entity
Framework



∙ NHibernate



∙ Doctrine




Templating



∙ NVelocity



∙ Smarty




Extensibility



∙ ASP.NET uses
Microsoft.NET framework.
So you can make use of any
functionality available on
.NET framework



∙ HTTP

Handlers



∙ HTTPModules



∙ ISASP Extentions etc.



∙ PECL


PHP Extension
Community Library






Easy to learn

Yes

Yes

Personally I found PHP to be
easier for a beginner to learn
programming


Recommended
for Huge
systems?

Yes

No

As per my analysis, PHP is
recommended
for small
-
to
-
medium projects and
ASP.NET and JSP for
medium
-
to
-
big applications


Content
Management
Systems



∙ DotNetNuke



∙ SharePoint



· N2CMS …



∙ Typo3



∙ Joomla



· Magento …

Wide verity of options


Advancement

Growing

very fast

Growing with limited speed

Micorosft’s team is keen to
develop and integrate new
features. But since PHP is
promoted by community, it
takes time to reach that level


Backward
Compatibility

Old code will work on new
framework versions without
change

Old code might need tweaks
to make it work on latest
versions




Security

IIS must improved from
past and now a days it is
one of the secure web
Major web servers are secure

ASP.NET, PHP, Oss and its
servers are mostly secure.
Now developer need to make

servers

sure his coding is secure.

Performance

Faster

Faster for small programs
and slower for medium
-
to
-
big programs

Very basic old argument


ASP.NET is compiled and PHP
is interpr
eted (line by line
compilation and execution)


Deployment

Multiple methods available

Eg: Publish, XCopy, MSI

You need to copy/paste code
to server somehow (eg: ftp)




Some useful
features



∙ WCF (Windows
Communication Foundation),
Web Service,
.NET Remoting
etc.



∙ ASP.NET AJAX



∙ Built
-
in Caching features

∙ Web Service



∙ Third party Ajax libraries



∙ Third party Caching
libraries




Built in classes







ASP.NET framework also
provides big number of built
-
in classes

Ho However, PHP provides
limited built
-
in classes









http://www.phpvsasp.net/final_report.aspx

http://www.codegain.com/articles/aspnet/general/php
-
and
-
asp
-
net
-
a
-
feature
-
list.aspx

What is php?

Hypertext Preprocessor

is a general
-
purpose

scripting language

that was originally designed for

web development

to produce

dynamic web
pages
. For this purpose, PHP code is embedded into the

HTML

source document and interpreted by a

web server

with a PHP processor module,
which generates the

web page

document
.


What is .net?

The

Microsoft .NET Framewor
k

is a

software framework

for

Microsoft

Windows

operating systems
. It includes a large

library
, and it supports
several

programming languages

which allow language interoperability (each language can u
tilize code written in other languages.) The .NET
library is available to all the programming languages that .NET supports.


What is ASP.net?

Asp.net is Microsoft’s free web framework. Code can be written in C# or VB or many others. It can target any brows
er.

ASP.NET

is a

web application framework

developed and marketed by

Microsoft

to al
low

programmers

to build dynamic

web sites
,

web
applications

and

web services
. It was first released in January 2002 with version 1.0 of the

.NET Framework
, and is the successor to
Microsoft's

Active Server Pages

(ASP) technology. A
SP.NET is built on the

Common Language Runtime

(CLR), allowing programmers to write
ASP.NET code using any supported

.NET language
.

http://en.wikipedia.org/wiki/ASP.NET

What is ASP.net MVC?

ASP.NET MVC is a part of the ASP.NET Web application framework. It is one of the two differ
ent programming models you can use to create
ASP.NET Web applications,

the other being ASP.NET Web Forms.

An MVC Application is designed and implemented using the following three attributes




Model:

The model contains the core information for an
application. This includes the data and validation rules as well as data access and
aggregation logic.



View:

The view encapsulates the

presentation

of the application, and in ASP.NET this is typically the HTML markup.



Controller:

The controller contains th
e control
-
flow logic. It interacts with the Model and Views to control the flow of information and execution
of the application.

http://www.asp.net/mvc/whatisaspmvc


PHP V/s ASP.net

Performance:

Php is an

interpreted language i.e. the code written is saved as it is and it runs from the code directly.

Asp.net on the other hand is an optimized and compiled language i.e. the code is reduced to a set of machine specific instruc
tions before being
saved as an ex
ecutable file. It is complied the first time it is run and then always runs as a complied code.

However, with an interpreted language you can do things that cannot be done in a compiled language. For example, interpreted
programs can
modify themselves by a
dding or changing functions at runtime. It is also usually easier to develop applications in an interpreted environment
because you don't have to recompile your application each time you want to test a small section
.

Graph shows the time taken to generate
and display results for a search a small website
:




The graph shows that ASP.net takes