Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
What is the best code to script, in means of speed?
Old 03-21-2007, 05:13 PM What is the best code to script, in means of speed?
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
I know how to script in PHP, JAVA, CGI, and little ASP.

What code is the best to use if i want to load my webpages fast?
I dont have a lot of content on them but when you have like 2 pages of information with code that needs to be executed... well it might take a while on a Dialup connection or somthing slow?!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 03-22-2007, 08:21 AM Re: What is the best code to script, in means of speed?
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
Quote:
Originally Posted by microcolt View Post
I know how to script in PHP, JAVA, CGI, and little ASP.

What code is the best to use if i want to load my webpages fast?
I dont have a lot of content on them but when you have like 2 pages of information with code that needs to be executed... well it might take a while on a Dialup connection or somthing slow?!
Great way to start a flame war
But, I'll throw in my $0.02 anyway.


CGI will generally be slower because it involves starting a new process for each request. So, even if your CGI program was written in tight assembly, the latency of getting it started would hurt performance. Besides the limit for number of processes on a machine (hurting capacity).

As for the rest, good code in any language will be faster than bad code in any other language.
Java can poentially be the fastest out of the ones listed because of JIT (just in time compilation) converts the byte code to native code, and runtime optimization (code gets more optimized the more it is run). The cavet being, development is more difficult and complex.

ASP can be almost as fast as java if you write your logic in C# or C++, compile and drop in a DLL. Putting code in ASP pages (as most do) can be buggy and slow.

PHP (on med to small sized projects) can offer the fastest development but, performance isn't the best. However, you can compile your PHP to gain a major performance boost. Though very few hosting services offer a PHP compiler.

On a side note, that fact that a user may be on a dial-up doesn't really offer any relevance at all. The only thing to help a user on a slow connection is to send back less data. You server platform makes absolutely no difference here. The only possible way it could affect things is multiple slow concurrent users will require more threads on the server.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-22-2007, 10:00 AM Re: What is the best code to script, in means of speed?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
What code is the best to use if i want to load my webpages fast?
(X)HTML + CSS

Quote:
I dont have a lot of content on them but when you have like 2 pages of information with code that needs to be executed... well it might take a while on a Dialup connection or somthing slow?!
Dialup vs broadband makes no difference to code execution time. The speed difference there is purely in the amount of data that is being transfered between client and server.

Quote:
Putting code in ASP pages (as most do) can be buggy and slow.
Only for the crap coders.

It doesn't have to be a .NET system to be precompiled. You can write ISAPI apps in VbScript and compile them into Object DLLs easily enough
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-23-2007, 07:40 AM Re: What is the best code to script, in means of speed?
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
Quote:
Originally Posted by chrishirst View Post
It doesn't have to be a .NET system to be precompiled.
True, there has always been the ability to write extensions in C++,VB,etc... too bad so few did.
Quote:
Originally Posted by chrishirst View Post
You can write ISAPI apps in VbScript and compile them into Object DLLs easily enough
Then it wouldn't be in an ASP page
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 08:18 AM Re: What is the best code to script, in means of speed?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You still need asp to create the object instance and communicate with it
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-23-2007, 05:13 PM Re: What is the best code to script, in means of speed?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Quote:
Originally Posted by willcode4beer View Post
Java can poentially be the fastest out of the ones listed because of JIT (just in time compilation) converts the byte code to native code, and runtime optimization (code gets more optimized the more it is run). The cavet being, development is more difficult and complex.

ASP can be almost as fast as java if you write your logic in C# or C++, compile and drop in a DLL. Putting code in ASP pages (as most do) can be buggy and slow.
Actually if you use ASP.NET ( which C# or C++ w/ Managed Extensions means ) your code will be JIT'd like java byte code. The only difference is it starts out as MSIL instead. Unless you ngen the code, in which case you have native machine code in your binaries. But there are a lot of advantages to the JIT method.

Also, I don't know whether PHP supports Thread Pooling ( and sort of doubt it ), but you bring up a very important point, and something that's actually a good advantage for ASP.NET, both as a framework that runs your code, and for the code you can write.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What is the best code to script, in means of speed?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49616 seconds with 12 queries