Slashdot Mirror


The Fastest Web Language On The 'Net?

TheCorporal asks: "Our company has come to the point in our development where we feel it is time for a recode. We are rewriting code for a large multiplayer, browser/text, turn based strategy game (Like Utopia), and would like to know the best language solution in terms of speed. A Rapid development platform would be nice, but most important is the speed of execution." There's more below, but the question is simple, which language is the swift hare of the net, and which one is the toiling tortoise, and where do the others fall, in between.

"Basically, we are not experts in any one language, but have quite a bit C/C++/Perl experience. The target platform will be Apache on *nix, but a portable solution would be good. At the moment we have the engine coded in C for CGI which then interfaces with MySQL to store game data. We are thinking of hacking in FastCGI support for a good boost in speed, but we feel a complete recode will be neccesary, as the amount of players in the game will soon be hitting 5 figures."

"At this point we pretty much know CGI alone is out of the question from a speed standpoint, so we are looking for something a bit more robust. We have heard that mod_perl may be a good solution, but have also heard the same for Python, PHP, C++, etc, so if anyone has experience with dynamic content like this, and has some suggestions and comments as to the merits of your choice, we would appreciate it."

Meanwhile, on the other side of the galaxy, slartiblartfast asks of his improbability computator, a similar question: "I have been wondering for a while if anyone has some really good metrics on the relative performance capabilities of the different scripting languages. By scripting languages I mean Perl, PHP, JSP, ColdFusion, ASP etc and by performance I mean how many pages can each one serve per second for the same hardware and load test? Every benchmark I have seen was commissioned by the creators of the technology that eventually won the test. i.e. The guys implementing the technology that won just happened to be on the core development team for the product. Now I just can't swallow that sort of thing, so I thought I'd ask here. Has a truly independent test been done that didn't favour one technology over another, or that at least invited the best from each area to build and optimize the site to be tested?"

Careful. There are lies, damned lies, statistics...and then there's benchmarks. It's a quote that's been seen often enough, here on Slashdot, but it still has its own bit of wisdom to impart.

265 comments

  1. Re:Language choice by Anonymous Coward · · Score: 1

    * ALL YOUR BASE ARE BELONG TO US: Annoying fad or rallying cry of the internet generation?

    (Please god, don't let Jon Katz see this)

  2. php by Anonymous Coward · · Score: 1

    FWIW, PHP seems to be the most stable all around. I don't know about 10000+ users, but it does well on just about everything else

    1. Re:PHP by Wastl · · Score: 1

      This may be true when using the application for just delivering content from a database or something similar that doesn't require to process data over several connections.

      On the other hand, complex web applications need a sophisticated session management and the program should not be called anew on every connection. True, PHP provides some session management, but Java Servlets tend to be much faster in such cases.

      Sebastian

    2. Re:php by linuxgod · · Score: 1

      PHP is slightly faster than perl depending on how you make it. Its a bit more secure as far as I am concerned. Perl tends to get a bit bloated under high loads. Slashdot itself is a good example of this.


      I took the blue pill !!!

    3. Re:php by Foppel · · Score: 1

      who cares about zend? you can use php perfectly without zendcache or compiler. if you want to cache have a look at apc, works perfect and is free...

    4. Re:PHP by PaxTech · · Score: 1

      PHP with the PHPlib packages provides session management, user authorization, templates & more in a very easy-to-use, efficient manner.. If you use straight PHP only, you're missing the boat.

      --
      PaxTech

      --
      All movements for social change begin as missions, evolve into businesses, and end up as rackets.
    5. Re:PHP by Malcontent · · Score: 2

      Actually php 4.x has native session methods too. I use them and they work very well.

      --

      War is necrophilia.

    6. Re:PHP by passion · · Score: 2

      If you add the Zend optimization engine, it's even faster if you're doing alot of loops and such.

      Yeah, I like Zend too, but there are other PHP caches available as well, such as:

      Haven't played with them myself, but I've heard plenty of good things about APC.

      --
      - passion
  3. XUL by Anonymous Coward · · Score: 1

    Hell, you could submit it as a lacking feature in Mozilla, and if you're lucky they'll code it in _for_you_ in their .9 milestone.

    1. Re:XUL by f5426 · · Score: 1

      Rotfl. Best one so far. Not sure he'll get the perf he needs, but there is no silver bullet.

      --

      1 reply beneath your current threshold.

    2. Re:XUL by f5426 · · Score: 3

      Bob wrote:

      [snipped explanation about why java and OO is best solution there, and why it can't work on bsd due to kernel limitations]

      You are clueless. OO is not a silver bullet for development. What fits you well may not be good for this guy. Hell, we don't even know what its problems are !

      Anyway, stop this insanity about non-preemtiveness FreeBSD scheduler that lack the spinlock reference counting in its module destructor, as it have been solved months ago !

      (And no, the myth that unix commands name have been choosed based on intestinal noises have already been debunked elsewhere. For instance, fsck was choosed for a different reason)

      Maybe I just bited an ignorant troll, but I can't let you spread your bullshit all over slashdot.

      Cheers,

      --fred

      --

      1 reply beneath your current threshold.

  4. PHP by Anonymous Coward · · Score: 1

    PHP runs circles around other languages, especially when you download the ZendOptimizer (a free download from zend.com). We host a site that gets in the neighborhood of 10 Million hits a month, with just about every page on the site hitting the MySQL backend with large amounts of data and it runs as fast as if you were the only one browsing the site.

  5. Java Servlet or Apache Module by Wastl · · Score: 1

    If the application has to serve dynamic content to a browser, I would recommend to use Java Servlets. This may appear to be a slow solution on first look (Java is 10-20 times slower than C in most cases), but there are some considerable advantages to this approach:

    • Java Servlets run over sessions: With standard CGIs, the program is called again and again on every connect and you thus have to deal with data exchange via slow means (i.e. files on the hard disk etc). Even when using FastCGI, you will have independent processes (but I am not familiar enough with FastCGI). With Java Servlets on the other hand, you have a shared data space, each connection is handled from a pool of threads and has access to the same data. Processes need not be started again, it's just calling a method when a connection is made.
    • Scalability. With Java Servlets you can easily have a cluster of Apache webservers and Java Servlet engines without changing the code
    • Rapid Application Development. Java Servlets are usually much faster to implement than equivalents in C or Perl. You have session management, threads, and many API functions built-in

    There is also a way to achieve this in C: Write an Apache module. This will almost certainly provide the maximum speed. However, the development effort will also be considerably higher.

    Sebastian

  6. Zeus vs. Apache, Velocigen vs. mod_perl by mholve · · Score: 1
    Zeus beat the snot out of Apache "out of the box" already, which I kinda expected - with Apache's motto being "correct first, fast second" and all.

    I should have the Velocigen vs. mod_perl tests soon enough, which I'm kind of anxious to see. I predict a similar stomping.

    Granted, neither of these are free products, but then again - speed always comes at a price, unless you're talking about hookers. ;>

  7. Perl? by mholve · · Score: 1

    If you're into Perl, check out Velocigen - it's like mod_perl, but a much, much better/faster design. Depends on if you want a free solution, or a commercial one and how fast you want to go. Everything Solaris will be doing a "shoot out" between Apache w/mod_perl and Zeus w/Velocigen, among others like iPlanet and Roxen shortly.

  8. Re:C or C++ Is probobly your best bet by TooOldForThis · · Score: 1

    Java servlets will beat c/c++/perl/[name your favorite language or scripting environment] in nearly all cases. The exceptions will be isapi/nsapi/apache modules written directly to the webserver api. The other benefit is the fact that you have access to the full java api, which provides extremely rich functionality - anything from sending email to building images on the fly is quite easily implemented.

  9. Re:Do it in Assembly by kraut · · Score: 1

    regarding your sig: Inheritance, and luck. If you're so smart, how come *you* ain't rich yet? (I'm not rich either...) :>

    --
    no taxation without representation!
  10. Re:Good design is fastest by mo · · Score: 1

    One other addition.
    PHP, JSP, or any other language that you can embed into your web server would be fine. Although I wouldn't use anything other than mod_perl or C apache modules, as long as you aren't forking your CGI as a separate process you should be fine.

  11. Re:JSP + Servlet + EJB = Heaven by the+red+pen · · Score: 1

    Thx for the clarification.

  12. Re:Analyze, Design then Code by quoll · · Score: 1
    I wouldn't rule out interpreted languages, because you're not going to be doing any "heavy lifting" in them anyway.

    This is a really good point.

    As an example, our local university is doing research in quantum computing, and is using a large beowulf cluster for simulations. All the libraries they use are written in C/Assembler, but the tasks they write are all in Python. This combination gives them fast execution, but the programs are fast and easy to code.

  13. Re:Consider removing Apache by PCM2 · · Score: 1

    Fair enough, but this is one reason Apache was designed with an API and is released Open Source.

    Investigate mod_perl, etc., before casting aside Apache.

    --

    --
    Breakfast served all day!
  14. Re:JSP + Servlet + EJB = Heaven by Zagadka · · Score: 1

    What, you mean a stack trace? What's so hard about that?

  15. The bottleneck is definitely the database. by KBrown · · Score: 1

    Since you can add multiple web servers running the same application in parallell and another one dedicated to serving images, you have to worry no more about the programming language you choose; any one will work just fine with enough machines.

    The main problem is that all your web servers will be connecting to the same database server so you need a database wich allows you to have a very large number of concurrent connections (in the order of hundreds or even thousands, 100+ connections per web server) without a big performance hit.

    Depending on the nature of your application you should also be thinking about the possibility of mirroring (for more selects than inserts/deletes/updates) or distributing (for the opposite) your database.

    I am thinking about Postgres 7 or Oracle because I've worked with them and they've proved (with enough memory) to handle the load of busy and complex web pages, but you can ask slashdot about the fastest and most scalable database for web serving.


    --
    Claim your namespace.

    --
    --
  16. Re:the quickest solution by pen · · Score: 1
    Believe it or not, that's the state I found my new employer's website in. The guy before me used Dreamweaver and a lot of layers to generate all of the pages.

    We're a training company, and there is a list of available courses (in static HTML that I update by hand). Then, there is an Apply link. When you click the Apply link, a window pops up with a form to fill out. Some fields in the form have to be pre-filled.

    Guess how those fields end up being pre-filled? There is a separate HTML file for every instance of the class. New class, new date, new HTML file.

    A few days ago, I was given the task of changing a few fields in this form...

    --

  17. EJB's performance actually sucks by skybrian · · Score: 1

    I've been coding in EJB's for six months (using WebLogic 5.1) and ran into the following problems (with entity beans).

    1) excessive database traffic. A single SQL query using bare JDBC turns into N+1 queries if you use entity beans. There's one query for the finder method, plus one query to load each row found by the finder method. This is a stupid way to query a database.

    2) excessive locking. Entities are locked (using exclusive locks) until the transaction completes. This can lead to lots of threads waiting on the same lock, or possibly even deadlocks. All that nice concurrency you get from using a database with row-level locking, shared locks, or read-only queries gets thrown out the window.

    3) gets in the way of SQL optimization. To get good performance you need well-tuned SQL. Container-managed persistence makes people think they don't need to learn SQL.

    4) reduced caching. The only thing WebLogic gives you for caching is read-only beans. On your own you can probably come up with much better caching strategies.

    We started out all EJB's and will continue to use them for our intranet since they're good enough for a low-traffic application, but will not use them for our Internet site. If I had to do it again I wouldn't use EJB's. (Although, to be fair, I suppose you could do okay if you used Session beans only and wrote all your own SQL.)

    1. Re:EJB's performance actually sucks by alecbrown · · Score: 1

      This is very true if you just use entity beans, a common beginners mistake. Look at using session beans more, and remember that with BMP you can limit the number of SQL calls and your entities don't have to have a one-to-one relationship with database tables. I havn't heard of anyone producing a production system using entities and CMP. EJB rocks, you just have to work out how to use it properly.

    2. Re:EJB's performance actually sucks by jb_nizet · · Score: 1

      1) That's true for BMP entity beans. If you use CMP and a decent CMP engine (look at Borland AppServer, for example), this will result in a single SQL call.

      2) That's one particularity of Weblogic. ALL the other containers use optimistic concurrency, and the latest WLS (6.0) also allows it.

      3) Using a decent CMP engine will save you lots of time: tuned updates, which only update the changed fields, etc. Again, look at Borland AppServer

      4) The spec gives you three caching options, called commit options A, B and C. This is flexible enough in most situations.

  18. Re:JSP + Servlet + EJB = Heaven by Mad+Browser · · Score: 1

    JBoss is an excellent Open Source EJB server, plus all the other J2EE goodies. Some say better than WebLogic.
    -Hunter

    --
    RateVegas.com - Vegas Reviews
  19. No, no, no (was:Do it in Assembly) by nosferatu-man · · Score: 1

    You people are making the problem MUCH harder than it has to be! Look around: I'll just bet that there are several networked computers with dedicated, HARDWARE interpreters, for the most powerful language of them all:

    PostScript

    C'mon! What's with all the unnecessary complexity? And as an added bonus, we can all start leveraging our huge investment in OpenStep (GNUStep for the FSF-inclined.)

    (jfb)

    --
    To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  20. Re:Do it in Assembly by MattJ · · Score: 1

    "I hand-filed gears, sprockets, cogs and pistons for my own Babbage Difference Engine, arranged for shipping for thirteen metric tonnes of high-grade coal from China, ..."

    What kind of wuss won't even mine his own coal?

  21. Re:Use The Source by meridian · · Score: 1

    or you could use the TUX kernel patch and write a c based cgi called from tux for anything dynamic

    --
    meridian at tha.net
  22. Re:Yes compilers are faster. That's why there's RI by Gumber · · Score: 1

    The other thing to consider when deciding between compiled code and assembly on modern processors (both CISC and RISC) is that the chips themselves do so many pre-execution optimizations in hardware that your assembly is probably being rewritten anyway. Probably better to compile and examine the compiled code for critical sections to make sure the compiler didn't do something really stupid and be done with it.

  23. System architecture & resource management also key by Gumber · · Score: 1

    It all comes down to design. Eliminating the overhead of CGI is good. Persistance is good. Keeping as much as you can in memory is good. Re-use of allocated resources is good. Using memory wisely is good. Eliminating dependancies so you can distibute the load over losts of machines is good. Taking advantage of the strong price-performance of x86 machines for CPU intensive stuff is good.

    Raw execution performance is important, but there are a million ways to slow your application down.

  24. ...duh?! by jstepka · · Score: 1
    --
    Justen Stepka
  25. Re:JSP + Servlet + EJB = Heaven by dglo · · Score: 1

    It's even easier to build a great OO design (using the Model-View-Controller pattern) if you dump JSP and use a template package like FreeMarker, Velocity or WebMacro. JSP lets you embed Java code in your webpage, so business logic gradually creeps out of your servlets and into your HTML, making maintenance more difficult. Template packages help you keep your business logic and page design separate by keeping the code in the Java servlets and the HTML in the webpage templates.

  26. Re:Analyze, Design then Code by SheldonYoung · · Score: 1

    I agree pretty much completely. I would add an extra step in there to figure out if the straight line speed of a C++ Apache module was worth the portability and difficulty of distributed processing penalty.

    My instincts would say sacrifice the straight line speed for something in Java that can be easily distributed, but I have absolutely nothing to base that on. Either way, I think you nailed it.

  27. Re:Language choice by maw · · Score: 1
    He seems to be pretty oblivious to things he doesn't want to see. Besides, to fully study and describe the all your base phenomenon probably requires advanced maths, particularly statistics; it's probably well beyond his ken. Then again, that assumes that he'd do any research at all. :)

    (When I mention statistics, I'm referring to the question I've asked about how many people it took to be talking about the all your base phenomenon for it to really take off. I expect that there's an exponential curve to be identified: people saying all your base are belong to us at every chance they get over time.

    But how is that sort of thing identified and tracked? To track it, does some net sociologist have to recognise the next all your base before it takes off? Can it be deduced from mail logs?

    Nobody I know has been able to answer these questions yet, but they all want to know the answers.)
    --

    --
    You're a suburbanite.
  28. Re:JSP + Servlet + EJB = Heaven by Tony-A · · Score: 1

    Assuming the ASM is done rationally, most of the ASM code will be slower than the equivalent C code, but the ASM subprogram will be faster because the optimizations will be done where it matters.

  29. Re:ahem... by bcaulf · · Score: 1

    I'm sorry, is that a rhetorical question?

  30. Re:JSP + Servlet + EJB = Heaven by selectap · · Score: 1
  31. Re:Esperanto! by Patrick+Lewis · · Score: 1

    Given, coding in Magyar is difficult, but then you do get Hungarian notation for free.

    --
    "If I am such a genius, how come that I am drunk and lost in the desert with a bullet in my ass?" --Otto (Malcom ITM)
  32. Re:Do it in Assembly by Dragonmaster+Lou · · Score: 1

    Not necessarily. Modern CPU architectures make writing assembly a bitch due to pipeline stalls, resource conflicts on the CPU, etc. A really good optimizing C compiler can do much better than the average human can with hand-coded assembly. Assembly still has its uses for small, embedded and low-level things, but it's no longer necessarily the fastest, especially if you have a good compiler.

  33. Re:JSP + Servlet + EJB = Heaven by lostguy · · Score: 1

    For equivalent purposes, the difference is minimal, and not worth the effort, since it's presentation code anyway. You shouldn't be mixing your presentation layer with your business logic.

    As for the difference between C++ vs. assembly, C vs. asm is probably a better analogy, as it is a one-step difference. (C is basically just a really nice macro assembler :-)) Your statement is mostly a myth in this day and age, anyway. A decent C compiler can produce faster code than hand-written assembly on most modern platforms, for anything greater than a microscopic example.

  34. Re:JSP + Servlet + EJB = Heaven by lostguy · · Score: 1

    php, optimized with zend's optimizer will outperform jsp by about 15%

    Be careful with that kind of generalization, unless you're going to post references. There's a huge variation in jsp engine performance. This is a vendor benchmark site (so take it with a grain of salt, especially where their product is concerned), but you can see how wide the range of performance can be between JSP/Servlet engines.

  35. Re:Consider removing Apache by lsd · · Score: 1

    I'd be inclined to go the other way - run Apache for dynamic content (my personal preference would be PHP btw - it's very fast, easily scalable and rock-solid, all things I wish ColdFusion, which I have to work with, were). Then run a lightweight high-performance web server like thttpd, boa or khttpd to serve static content. It's fairly easy to set up khttpd so that it'll serve any requests for static files itself and transfer any dynamic requests on to an Apache server running on a different port. thttpd has some PHP support as well - that might be worth looking into too.

  36. Re:Servlets are pretty good, I would question MySQ by look · · Score: 1

    I'd have to agree. MySQL is pretty fast for basic stuff, but try to do anything more than a 3-way join on a decent-sized table, and you can go get yourself a cup of coffee while you wait for the results...*sigh*...I know this from experience.

    PostgreSQL 7.1 is supposed to be all that, though. Anyone know if it has seperate tablespaces yet?

  37. Re:Consider removing Apache by p3d0 · · Score: 1

    "Primary bottleneck" and "all the other bottlenecks"? How does that work?
    --
    Patrick Doyle

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  38. Re:Don't do it in Java by buzzword · · Score: 1

    Aren't ad hominem arguments cool?

    I know Java is but what am I?

    Anyway, I refer you to the February 2001 issue of Java Report, specifically to an article entitled "High Performance Java Software Development". One of the timing comparisons presented in the article mentions that it can take Java (HotSpot JIT) as much as 115 seconds to run a 1 million point quicksort. It takes C++ 0.88 seconds to do the same.

    --
    The universe is bad enough without people poking it. -Mustrum Ridcully
  39. Re:Language choice by civilizedINTENSITY · · Score: 1

    Wouldn't it be more like the "disease vector"s that the NIH refers to? I'm think graph theory and linear alg. as much as stat.s

  40. nano by ViGe · · Score: 1

    do I need to say more?
    --

    --
    It has to work - rfc1925
  41. Re:PHP4/Postgres (really!) is your best bet by dinky · · Score: 1

    A free alternative for Zend is APC.

    Check it out at http://apc.communityconnect.com/
    ;)

  42. Use what you know. by Ekman · · Score: 1
    The speed differences between various languages is not so important as the speed differences between various technologies. CGI for example is going to be slower in any language and on any web server, than using some sort of in-process API.

    Choose a fast web server that allows you to embed scripts inside the server process. Apache gives you lots of choices in this area: mod_perl, mod_python (and mod_snake), PHP or even C. But Apache isn't exactly the fastest web server on the face of the earth (but it should be fast enough). AOLServer is very fast and lets you use Tcl or C (PHP works too, I believe).

    The point is that you should use the language you're familiar with and spend more time worrying about the environment the software will execute in. That's where you're going to get the most performance improvements.

  43. Re:Do it in Assembly by psykocrime · · Score: 1
    No, no no.... It's obvious that the only solution for this guy is a mixture of:
    • Haskell
    • Oberon
    • RPG/400
    • Fortran
    • PCL
    • Algol-68
    --
    // TODO: Insert Cool Sig
  44. Re:Language choice by psykocrime · · Score: 1

    Screw Ed. Emacs is the best editor!!!

    --
    // TODO: Insert Cool Sig
  45. What are you... by iiiFEAR!!! · · Score: 1

    a retard? C is hands-down the fastest mostly-cross-platform language on the block. What CS school did you go to?

    --
    "First rule of government spending: Why build one when you can build two at twice the price?" -- Mr. Haddon, Contact
  46. Re:Consider removing Apache by phutureboy · · Score: 1

    Would it be possible to take the Apache source, and dumb it down to cut all overhead but the processing of a specific module, run it as a seperate server, and get the same effect?

    I think it helps to compile Apache with the smallest possible set of modules - i.e. the bare necessities. Some configuration directives can make a difference also.

    --

  47. Re:Do it in Assembly by rumba · · Score: 1

    This thread has had it. I mean, it's like a bunch of old guys comparing willies to see whose has the most wrinkles in it. Then, after the fun is done, nobody can even remember what got them started...

  48. Some information on Python by eAndroid · · Score: 1

    Python on its own is not a speed demon by any means. What it is fast at is development. And it is extremely fast.

    I've found that whenever I need my Python to go faster coding up a simple C module for python is as fast as I'll ever need. I've gotten a 100x speed improvement by writing a simple text manipulation function in C.

    However, more to the point of your web-based interface question, I don't think that language selection will really have much bearing on your actualy real world performance. I mean, look at Slashdot! It is written in Perl and not even the most optimised perl, and yet they are handling extremely large amounts of traffic.

    I'd let slashdot be your model and use what they use: hardware. While perl is faster than Python the development time you save should let you afford more hardware if you need it. But I don't think you'll need it.

    --

    I can't spell or type, but that doesn't mean I'm unusually stupid.
  49. Re:JSP + Servlet + EJB = Heaven by captredballs · · Score: 1

    Was this with servlets in mind? It seems that the nature of servlets would lend itself to JIT particularly well.

    --

    I suppose I'm not too threatening, presently, but wait till I start Nautilus
  50. Re:Servlets are pretty good, I would question MySQ by CoJoNEs · · Score: 1

    You can get almost any major RDMBS (like oracle or DB2) for development purposes for free. You other point is pointless too, if you want speed you need the information ready at all times, why would you wait for your box to load it into memory? I would assume the machine should be dedicated to the task at hand, no worring about trying to find life in outer space with its "free cycles"

  51. PHP and the Zend engine by JDizzy · · Score: 1

    PHP is what I use strickly because it was designed from the ground up to work on the web, and to be extreamly fast. The Zend engine, for those that dont' know, it's the component that watches the behavior of the php scripts and then optimises the apache server accordingly. I liken the functionality to the code-morphing tech in the Transmeta chips in that Zend looks for more efficient ways to run your scripts. This is unlike other technologies such as mod_perl, for example, that dont' use any realtime optimization. I cannot comment on CFM, JSP, or ASP cuz I dont' know enough about them, but I do know that most folks say PHP is faster than them, but again it might be the jaded remarks of PHP enthusist. I think that C/C++ would be fast, but please, its not a fast process to develop in, and will take more time than a scripting language to implement. If you think c/c++ will take a long to to implement, the Assembally with take twice as long. These compiled solutions are not RAD (rapid application development). Unfourtunatly I hear ASP is good for RAD, but do you really want to support a proprietary system that doesn't work so good on Unix w/Apache?

    --
    It isn't a lie if you belive it.
  52. Re:Answer + Pool by MarkyMo · · Score: 1

    * time to change jobs ?

  53. Re:Do it in Assembly by jmp100 · · Score: 1

    Not quite. C++ is pretty efficient but when you get down to it, it is still quicker to use assembly.

  54. Re:Do it in Assembly by jmp100 · · Score: 1

    Assembly wrapped in some minimal supporting C is probably the best.

  55. Re:Language choice by jmp100 · · Score: 1
    I hate them both. Especially vi.

    It's all about joe. WordStar, baby!

  56. Re:More to Speed than Language by jmp100 · · Score: 1
    One more thing: Don't use DSO. It slows the core and surrounding modules down by 5-10% according to the Apache docs. Build everything in static-style.

    Also, if you are using PHP, use a cacher (such as the Zend cache or one of the free cachers), as well as the extra Zend optimizer binary. The cacher keeps compiled PHP code so that it doesn't have to be parsed, lexed, etc. every time the page is loaded.

    PHP also has a smaller memory footprint than perl, but IMO the solution to this is to use whichever language suits you better and buy more RAM as needed.

  57. Re:JSP + Servlet + EJB = Heaven by naasking · · Score: 1

    The point is if you're running a server app, the amount of time to start to program is insignificant compared to the amount of time the program will be running. Consequently, the speed once it's started up and going is what's important. So it's not a gimmick. JITC is less significant to the average user who starts up a Java program every once and awhile since the loading and translating overhead is incurred each time.

    -----
    "People who bite the hand that feeds them usually lick the boot that kicks them"

  58. Re:JSP + Servlet + EJB = Heaven by Serpent+Mage · · Score: 1

    And using them will make you want to go gcj@#$!@#

    Talk about a nightmarish java compiler.

  59. Re:JSP + Servlet + EJB = Heaven by curunir · · Score: 1

    I would be very hesitant to base any enterprise solution on any of the current templating languages. There's just too much String manipulation happening at runtime.

    Also, last time I checked (approx three months ago), these language were missing some very important features. For example, WebMacro has no for loop, only a foreach loop. This means that during runtime, you must recurse through the entire collection, not just the desired sub-collection.

    There really isn't one good answer out there that seperates out view logic from application logic, but the eventual solution *will* be JSP (read: taglibs...struts is headed in the right direction, just down the wrong path)...JSP's are only messy if you have java code in them.
    </$0.02>

    --
    "Don't blame me, I voted for Kodos!"
  60. linux kernel? (Re:Consider removing Apache) by Punto · · Score: 1
    You'd effectively have two servers running

    I saw an experimental option on 2.4.2, an httpd on the kernel that servers the static pages, and leaves all the other requests for the normal httpd.
    I've never tryed it, but sounds nice.

    --

    --

    --
    Stay tuned for some shock and awe coming right up after this messages!

    1. Re:linux kernel? (Re:Consider removing Apache) by spinfire · · Score: 1
      This is a different issue; The KHTTPD server will serve static stuff (HTML, Images) within a kernel module and pass the rest of the requests on to a userspace server like apache, or roxen.

      This is messy; I personally don't like the solution. It might work well for running on a dedicated image server, or such, but it seems to be unworthy of praise otherwise.

  61. Re:what numbers? by Caspuh · · Score: 1

    ...and the other half are from ZDNet, so they could be made up as well.

  62. Re:Language choice by timmyd · · Score: 1

    The real reason they stop arguing is because they know that ed shines in very few places and that you probably aren't serious suggesting it over everything else.

  63. Re:Servlets are pretty good, I would question MySQ by Master+Bait · · Score: 1
    I agreee. It's better to buy a faster PC CPU -- if they're at that level. That's because it's better to go home at 5 than it is to go home at 7:30.


    blessings,

    --
    "Only in their dreams can men truly be free 'twas always thus, and always thus will be."
    --Tom Schulman
  64. Wait a minute, compiled is fine in more situations by moogla · · Score: 1
    Generally, you don't write compiled CGI that gets rolled into the server. You can get significantly better speed and use of memory, but this is more complex than it's worth. Using compiled CGI, you do not need to restart the server when you recompile something.

    In fact, you can emulate a lot of the features of stuff compiled into a module by using very small compiled CGI that do very little, and pass off the work to server processes/SQL/whatever. By avoiding linking to libraries you can avoid, and reducing code/memory size you reduce overhead. Also, try having only a few executables with lots of features, and hardlinks to them with different names for different purposes (think shell commands for root floppy disks, where cat, ls, and more are all the same proggy)

    On a completely unrelated note, I've had good experience using Makefiles to keep the state of the CGI scripts up to date when making modifications, if that is another concern.

    --
    Black holes are where the Matrix raised SIGFPE
  65. Use C. Or C with C++ wrappers. by moogla · · Score: 1

    I have had great experience with using C and C libraries for developing websites. They are incredibly fast. To reduce overhead, consider using FastCGI (it's really cool too, but I haven't tried using it. I only know what it can do from other people where I work). Or you can do what I do, and make your cgi apps REALLY small (&lt100K) so they don't ever leave memory when they get called. And make them handle only the work associated with formatting/displaying the HTML and relaying requests: put all the heavy processing in backend server and communicate via sockets or better yet, IPC shared memory.

    --
    Black holes are where the Matrix raised SIGFPE
  66. Re:Answer + Pool by Verloc · · Score: 1

    I really can't help myself. It's POLL, not POOL. Sorry

  67. Re:Some data points by Michael+Duggan · · Score: 1

    As long as we are posting language performance comparison sites, The Great Computer Language Shootout should be mentioned. You can specify your own weightings for the various tests in the shootout, and the page's author is always looking for ways to improve his tests.

  68. Re:Compiled: Specifically, Delphi, BCB, and Kylix by abiogenesis · · Score: 1

    The .tgz file that contains the Indy Demos that ships with Kylix has some distribution problems. Some files were omitted in Borland's .tgz and other files had their case changed which has caused nearly all the demos not to compile.

    --

    Donate free food to the hungry at The Hunger site.
  69. Re:Servlets are pretty good, I would question MySQ by abiogenesis · · Score: 1

    From PostgreSQL To Do List:

    Under the title "EXOTIC FEATURES":
    Add the concept of dataspaces/tablespaces

    ...it is not planned for 7.1

    --

    Donate free food to the hungry at The Hunger site.
  70. Re:Esperanto! by maxxon · · Score: 1

    Don't laugh -- Interstelen is a similar game to what's being discussed here (though not as massively multiplayer presumably), and has an Esperanto name. (It's being written in Python, though.)

    --
    max
  71. Re:Speed is relative by Darlok · · Score: 1
    ... and my apologies. My brain somehow dumped the fact that you were using MySQL.

    But still, the question is valid. MySQL has all sorts of different performance modes depending on the table type you use and the numer of connections you form to it. If you only have one connection passed around to all of your script executions, that's one thing. If you have a new connection for each script execution, that's another.

    The particular language you use won't really save you there. Anyhow... My $0.02.

    --
    Notice: Your mouse has been moved. Windows will now restart so this change can take effect.
  72. Custom HTTP server by SClitheroe · · Score: 1

    Basically, it sounds like you need a dedicated game server, not an HTTP server tied into a game backend.

    I'd create a custom HTTP server, that has the game logic built right in. Thanks to open source, getting a fast efficient HTTP handling mechanism is easy (strip down Apache, or look at some other, smaller open source servers). Then just add your game logic, either as statically linked code, or even better, as loadable modules of C or C++ code. You get the best of all worlds; HTTP support, blinding speed (no CGI interface overhead, no JVM, no script interpreters, etc), all in a tightly integrated package.

  73. Re:Do it in Assembly by mini+me · · Score: 1

    An abacus?

    Back in my day we had to use our fingers. Each finger representing a bit, giving us a whole byte. (we didn't use our thumbs) But we knew how to optimize code back then so it was a non-issue. One byte ought to be enough for anyone right?

    0100 0010 was comonly used while debugging! ;)

  74. Re:JSP + Servlet + EJB = Heaven by soygreen · · Score: 1
    Many "web languages" are page-centric. PHP, and ASP are like this. Other "web languages" take application languages and tie them to a page-centric mode. Mod-perl does with as does ASP+COM.

    Actually, that's not true. You must be thinking of some system built on top of mod_perl, like Embperl or Mason. By itself, mod_perl is exactly like writing an Apache module, but in Perl. It's a lot closer to Java servlets than to PHP or ASP.

  75. Re:Speed is relative by soygreen · · Score: 1
    PERL is multipurpose, but won't win many road races for much of anything.

    When used with mod_perl, Perl is fast enough for just about any web site. In fact, so is PHP, or Java.

    Python is getting closer, but it's still not the fastest.

    In most of the benchmarks I've seen, it's the slowest. Even so, it's probably fast enough.

  76. Re:Do it in Assembly by imcsk8 · · Score: 1

    you're right, it would be a cool nightmare to code a software like that in assembly

  77. Re:Servlets are pretty good, I would question MySQ by OAB · · Score: 1

    Anyway, Oracle just released migration tools for MySQL so they must know that SOMETHING is up

    Could it be that lots of people have found that MySQL is not up to the task, so they are switching to Oracle?

  78. Re:Do it in Assembly by Mold · · Score: 1

    Well, I agree about the C++ and the optimized compiler.

    Even if they did code in assembly, it doesn't mean that the code will run any faster than the C++ unless they have some seriously hard core assembly programmers.

    Most programmers just won't know all of the little tricks that the compiler writers will have used to optimize the output, and the compiler will be tweaked over time with improvements, where the assembly programmer will still be using the same techniques and macros that he has always known.

  79. Tcl by DavidNWelton · · Score: 1
    Tcl is an excellent solution, available also for Apache in the form of mod_dtcl, neowebscript, or other systems. There are several reasons to use Tcl:

    It's easy to use, even for the web people who often don't have a lot of programming experience.

    It has a great C API, so that you can write the really speed critical components in C, and call them from your Tcl code.

  80. Re:Analyze, Design then Code by fayd · · Score: 1

    Actually, I'm writing an application right now in Java. We're delivering content via JSP, with a distributed Java backend (using RMI). We're only going to have a couple hundred operators hitting this app so performance isn't a huge issue.

    However, our developement/testing/production environments are NT+Sun/Sun/HP. Java's portability saves us more headaches than everything else combined causes.

    Considering the poster probably has a bit more control over his environments and he's talking a two orders of magnitude larger user base, I wouldn't bother with Java at all.

    Stick with the HTTP protocol so you don't have to develop a client and go with C or C++ for the server.

  81. Tomcat 3.1 & tag libraries by Sir+Runcible+Spoon · · Score: 1
    Have you tried Tomcat 3.1? It is quite a bit faster than the previous versions and we are moving over to it from JRun.

    You're right about tag libraries they really do make the whole JSP thing worthwhile. There is a good introduction in the Wrox JSP book available here.

    1. Re:Tomcat 3.1 & tag libraries by The+Mayor · · Score: 2

      Yep. I run Tomcat 3.2 (yes, that is the current version, and yes, Tomcat 3.1 was still about 1/3 as fast as JRun & Resin) on my website, where all pages are dynamically generated. Mainly because I'm too cheap to buy JRun or Resin (Resin, btw, is free for personal use).

      But JRun & Resin both outperform Tomcat 3.1 & 3.2. But Tomcat 4.0 is supposedly a lot better. I simply can't rely upon it until the development is a little further along.

      And, I can't say enough good things about JSP tags. They are the "right" way to do dynamic web authoring.

      --
      --Be human.
  82. Re:JSP + Servlet + EJB = Heaven by avandesande · · Score: 1

    Are you using this with swing or awt? cgi stuff would not use any of these classes and i suspect/hope that using it with text only stuff would be less buggy.

    --
    love is just extroverted narcissism
  83. Perl/C/C++ by Darkness+Productions · · Score: 1

    C/C++ would probably be the best for overall speed, just because it is fully compiled and could run like lightning, provided that there weren't any memory leaks or the like. Perl would also be a good choice, just because of it's extremely large abilities. ASP/ColdFusion/PerlScript is always bad because they are so damned slow. We use ASP at work, but I would much rather use Perl/PHP to do the same thing.

    1. Re:Perl/C/C++ by MarkCC · · Score: 2

      If you're dealing with a web application interfaced with Apache, and communicating with clients through the network, and data coming through a relational database, than it's almost definite that the speed difference of C or C++ simply won't make any difference.

      You've got to focus on what causes the performance bottleneck, and address that.

      In web based applications, there are generally three bottlenecks:

      1. CGI. The time that it takes to invoke a CGI script is generally quite significant. The load time generally dwarfs the execution time. If you can use a system that allows you to avoid the loading cost, you're winning, even if your computation is a couple of orders of magnitude slower.
      2. Database Access. Performing an operation against a relational database is IO intensive, and thus time consuming. Again, the time spent on database related IO and marshalling/demarshalling usually dwarfs the time spent computing using the data.
      3. Network communication. Often the most significant bottleneck of all. If your user is submitting stuff via http, then they see round-trip times for each submission that are seconds long. For most applications, the time savings of C vs Perl (which are quite large) are utterly unimportant when you realize that they don't matter once considered against the intrinsic latency.

      So the real advice is: choose a language that handles your bottlenecks best. If you are really doing something computation intensive that takes a long time in Perl, then it's worth writing in a highly efficient language, like C++, or OCaml.

      But if your bottleneck isn't really computation, then you might be much better off using some else. If it's CGI load time killing you, than writing in Java (with Jakarta), or Perl (with mod_perl) or Python (with mod_python) will be significantly faster than a C++ program loaded through CGI. And any of the other languages will likely be easier to use than C++.

      If it's database IO time, then leaving the language alone, and redesigning your tables to optimize database access may payoff much better than changing languages.

  84. Re:Consider removing Apache by ganjuror · · Score: 1
    uh... Isn't that what Apache MODULES (ie: php, mod_perl, etc) are for? How much more can you truly optomise a server than embedding the processing of scripts IN apache? Would it be possible to take the Apache source, and dumb it down to cut all overhead but the processing of a specific module, run it as a seperate server, and get the same effect?

    note: I'm hardly a 31337 h8x0r, so I may well be missing something... I'm only asking that the more 31337 enlighten me, and anyone else who may be reading ;)

  85. Re:Esperanto! by Fishstick · · Score: 1
    you mean...

    [Man, what a bitch it would be to try to code in Magyar...]

    Man, at first you said "Marglar" - now THAT would be a bitch!!

    #!/usr/bin/marglar
    $marglar = "Marglar!";
    marglar "Hello there. What is your marglar?\n";
    $you = ;
    marglar($you);
    marglar "Hello, $you. Marglar to $marglar.\n";

    (Slightly obscure South Park reference...)

    (sorry, someone pointed a gun to my head and made me repost this for you... on second though, maybe that wasn't really a gun... ewwwww!)

    ---

    --

    There is much cruelty in the universe, John.
    Yeah, we seem to have the tour map.

  86. Re:More to Speed than Language by stu_coates · · Score: 1

    Yep, agree 100% that the site sucks... we're working on it and I can definitely assure you that the new site is free from flash and other stuff like that... The site is being re-done from scratch and will be up in a week or two.

  87. Re:More to Speed than Language by stu_coates · · Score: 1

    You should try to chose a development environment and platform that will enable you to scale up to your required user population, and then if higher performance is required then invest more $$ in hardware/bandwidth.

    For example, if your chosen backend server can swamp a T1 without breaking into a sweat then the obvious is to buy more bandwidth. On the other hand if you become CPU bound, you should be able to add more CPU power and your environment should simply extend to take advantage of it.

    In my experience, if you architect the server-side correctly the network will always be the limiting factor to performance.

    <shameless plug> The company I work for has benchmarked very large user systems and have quite a bit of experience with this... </shameless plug>

  88. Re:Esperanto! by seanmeister · · Score: 1

    goddammit.
    Sean

  89. Re:Not just language... it's all in implementation by ryuko · · Score: 1

    Um, not to be biased or anything, but I should trust the benchmarking results on the _vendor's_ site?

    If that's true, Microsloth has benchmarks that says that ASP is the fastest language and they have a bridge to sell for only 2 dollars.

    Ever lovable and always scrappy,

    --
    Ever lovable and always scrappy,
    kawaii
  90. Re:Do it in Assembly by Saint+Aardvark · · Score: 1

    LOL...

  91. Re:Do it in Assembly by Saint+Aardvark · · Score: 1
    Let this be a lesson to you...preview, preview, preview.

  92. Re:Do it in Assembly by Psiolent · · Score: 1

    Better yet, design your own microprocessor for the game and write the entire thing in microcode.

    -----

  93. Re:Do it in Assembly by Psiolent · · Score: 1

    Oh absolutely...the development, as all good microcode/microprocessor programmers/designers know, should be done with a wire wrap kit, or better yet, wires and vacuum tubes. But once the product is developed and debugged it would be entirely inefficient to wirewrap every unit sold. For this the industry standard production techniques should be used (probably not circuit board etching, though, since we are producing chips). Of course, maybe this is what you meant. If so, my apologies.

    -----

  94. Re:Yes compilers are faster. That's why there's RI by njyoder · · Score: 1

    First off, I just to need to reiterated that RISC stands for (Reduced Instruction) set not (Reduced Instruction set).

    Reduced Instruction Set Computer, oops?

    With CISC complex instruction, often 1 long to execute instructive can get into the chip, and halt everything until it finishes. I believe this is why overclockers get burned. But with RISC commands, the chip is able to quickly handle each one, and on most modern achitectures it is able to handle 3-4 RISC commands at the same time.

    1 CISC instruction functions as several RISC instructions, so that's not relevant. As for handling several instructions at the same time, the same applies for CISC (thats a cpu specific thing). With MMX and SSE in the Pentium family, you can do multiple mathematical operations simulatenously. Also, it's not like x86 has only one pipeline, like you're making it out to be.

    I believe the chip dymanically assumes and tries to optimize the best use of those 40 from 8 by looking ahead, but it *might* occur in the compiler, but that seems less likely. Either way, the coder is only able to access the 8(AIX, BIX... etc...)

    It's the compilers job to make optimal use of the reigisters... Anyway, AIX is a register? Could have sworn it was something else and that you really meant EAX, EBX, etc...

    If the same register is being used for many commands, but the output of one command is not needed for a future command that uses the same register, the chip will switch the future command to use a different register. So mastery of assembly does not guarentee more faster programs, one also needs to know what chip they are working on, and how it will attempt to optimize the code.

    The compiler does such optimizations, it decides what the registers are going to be used for, unless you have some super intelligent chip with a built in optimizing compiler. Mastery of assembly DOES guarantee faster programs, if one doesn't know how to optimize for the chip well they are working on, obviously they don't have mastery of it. You speak as if the chip as if it were an optmizing compiler, it's not. It does try to do things to speed things up, like with branch prediction, but not to the extent you're implying. Anyway, someone with mastery of assembly will write code so that the optimizations the chip can do, will work out well (i.e. write it so the branch prediction part of it does predict correctly [no miss!])..

  95. pico by ugly_bob · · Score: 1

    pico (walk away slowly)

  96. You have got to be a troll by codepunk · · Score: 1

    Java crap is slow as hell just hit any jsp site to see how bad. even poorly written perl or python could hands down smoke jsp. Hell I bet even cold fusion can beat that junk

    --


    Got Code?
    1. Re:You have got to be a troll by Spamuel · · Score: 1

      You're the one that's coming off sounding like a troll. Did you read the benchmark? Read this one too while you're at it. Perl and PHP are not necessarily faster then JSP/Servlets, that is a myth propagated by people who think that anything Java = applet. While you were off coding in language X technology changed, and guess what, Java has progressed over the past couple years, just like every other programming language. So keep your eyes open and give it a second look.

  97. Re:Do it in Assembly by FortKnox · · Score: 1
    I think he'd be better off with a colorful combo of :
    • Fourth
    • Ada
    • Prolog
    • And LISP


    --
    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  98. Re:Look for the bottleneck first... by stephenbooth · · Score: 1

    Based on what I've learned working with databases the rough ranking for performance impact is something like:

    1. Network Speed
    2. Disk Speed
    3. Processor Speed (and number of processors if multi processor)
    4. Memory/Bus Speed

    The last two are probably interchangable.

    If you have your application on a separate box from your database then it might be a good investment to have a second network card in each to hook them directly together, maybe even go for a fiber link if you've got the money. If your database supports stored procedures it would probably be worth moving some of the processing within the database to minimise the amount of data being sent over the network.

    Disk speed is particularly important in databases. If you're doing a lot more lookups than inserts/updates then you'll probably want to have lots of indexes, if you're doing more inserts/updates then you want to keep the number of indexes to a minimum. If possible you want to have indexes on a separate disk (separate disk controller if possible) to your tables. If performance is important avoid RAID 5, go for RAID0+1 (Striping and Mirroring). Loads of memory can help with disk speed bottle necks as it means that you can avoid swapping and paging and that you can have big database and disk caches so avoiding unnecessary disk reads and allowing writes to be scheduled for lulls. If your OS support asynchronous writes consider enabling that. If disk speed is your problem then choosing a language that lets you avoid dynamically loaded modules can be helpful (ideally you want to load each module once then leave it pinned in memory).

    Processor speed is really the only one that links the language itself. Obviously anything that needs to be interpreted will take more cycles than something that will run native. C/C++ can be remarkably portable so long as you avoid implementation specific calls. Try to keep such calls to a minimum (only use them when you have to or where there is a significant performance advantage) and when you do use them try to keep them to isolated functions. Hopefully when you come to move to a different platform you'll just have to make some minor edits then recompile.

    Not a lot you can do about Memory or Bus speed other than move to a different architecture.

    Stephen

    --
    "Don't write down to your readers, the only people less intelligent than you can't read" - Sign on Newspaper Office Wall
  99. Re:Good design is fastest by BeenaBerry · · Score: 1

    As with everything though, it's a trade-off. Keeping the database workload down is no good if that means the database has to return you 10000 rows instead of 2. That's a lot of data to shift around (between processes and possibly across a network) and it's not fast to move it around. With a couple of indexes and a join, the database can avoid looking through the data at all except for the couple of rows you want.

    Answering the poster's question is impossible, although my piece of anecdotal evidence is that a database-heavy web application performs around 2-3 times faster implemented with JSP for presentation and standard Java classes for business logic and database lookup than it did with page-centric PHP. Cacheing the results of slow-changing database queries is a very useful speed-up too.

  100. Re:Servlets are pretty good, I would question MySQ by duffbeer703 · · Score: 1

    Dude, please get a fucking clue before you post drivel.

    RDBMS are almost like mini-operating systems by themselves. Oracle, Informix, Sybase, etc all manage disks themselves and allow the tuning of various threads and data structures for performance.

    MySQL is great for some limited applications, it gives a fast, convienient interface to large amounts of data with minimal training or operational costs. MySQL is especially useful for databases with a low read/write ratio.

    The big commercial databases have alot of advantages, mainly in the area of data integrity. No 'free' database is able to guarantee the integrity of your data. MySQL and Postgre (as of the last time i used it) are not capable of performing online backup or parallel online-backups.

    A large multi-user system requires a 'real' database. Period.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
  101. Re:PHP/Zend is free! by oingoboingo · · Score: 1

    We've got loads of them running, and didn't need to pay a dime in licensing fees.
    wow...that's just like our copies of Visual Studio and Office!!!

  102. 4 Web Scripting Languages Compared - PHP + Cache by gempabumi · · Score: 1

    First, read this slash about 4 Web Scripting Languages compared. It refers to a ZDNET article which benchmarked and came up with the following results:

    PHP: 47pps
    ASP: 43pps
    CF: 29pps
    JSP: 13pps
    (pps = pages per second).

    The JSP was done with Tomcat, which is apparently not the fastest implementation.

    The real interesting thing is, the test was done before the advent of caching technology for PHP. Since then, the Zend Cache and the APC Cache have been released. Now, sit back for a second.

    I played around with these babies. Generally, the APC cache doubled my pps, and the Zend Cache QUADRUPLED my pps. Other benchmarks posted on mailing lists showed comparable results. (Note that the tests were done on the same server with the same apps using ab - and of course the results weren't so good for particlulary db intensive pages). I am not shitting you about those results. The stuff flies as the cache stores the compiled object code and doesn't need to recompile on every pageview.

    So, lets look at those results again and hypothetically extend them (just for shits and grins):

    PHP+ZendCache: 198 pps
    PHP+APC: 94 pps
    PHP: 47pps
    ASP: 43pps
    CF: 29pps
    JSP: 13pps

    Not sure where mod_perl, C, or native servlets fit in there, but that's a pretty impressive showing by PHP.

    g

  103. Re:JSP + Servlet + EJB = Heaven by SlipJig · · Score: 1
    I agree, Java's a nice environment. Too bad I never get to use it :(

    Check out the Resin JSP/servlet engine - the authors claim it's faster than mod_perl and mod_php. If you're targeting Apache and you believe them, it might be worth looking at.

    I've installed it (painlessly) on IIS and Apache and played with it, no real performance measurements but it seemed pretty fast.

    --
    Read my keyboard review.
  104. Missed a point about RISC by satch89450 · · Score: 1

    Just a small comment about RISC: in the lower-end RISC computers, there is no hardware to resolve resource collisions or perform memory timing -- that's done by the compiler at code generation time. If you are stupid enough to try to use a register before it's been filled, that's your tough luck. Ditto if you do a memory access and you access the data register too soon, or get "out of sync" with the memory clock.

    CISC machines hide these details.

  105. Perl and PHP are da sheit! by WhyPanic · · Score: 1

    JSP is inherently slow, and taxing on a system (read you need an expensive system). ASP on Linux, I am very wary about because most people automatically associate ASP with M$ IIS/SQL Server. Perl has good speed on any system, and it is easily integrated into an Apache MySQL system. Then again if you are doing Apache/MySQL why not PHP?

    --
    ...see you auntie
  106. Re:Analyze, Design then Code by revin · · Score: 1

    If you want speed....You can pretty much eliminate any interpreted language (e.g. Tcl) and web script (e.g. PHP, ASP, ColdFusion).

    Note that the version after Coldfusion 5 (Coldfusion NEO) will actually deliver compiled java code. The c-engine is completely being rewritten in java at the moment.

  107. Re:Language choice by nekid_singularity · · Score: 1

    I finally apprecciated how wide spread the all your base meme is today. I was reading everyone's favorite right-wing rag "The New American" at school when I saw it on a fictitious placqard(I know i didn't spell that right) in a picture for an article about the McCain-Feingold campaign finance reform bill!

    --
    Numbers 31:17,18 Now kill all the boys. And kill every woman who has slept with a man,but save for yourselves every virg
  108. Re:Not ColdFusion or ASP by guinsu · · Score: 1

    Yeah but ASP-Javascript is really cool. Every Micrsoft basher always forgets that you can use Javascript with ASP. And if you code your modules correctly, it makes fo ran easy conversion to C/C++/Java at a later date.

  109. Re:Language choice by humtibum · · Score: 1

    I don't know about the internet, but the rule of thumb for TV is: if >20% of a group (a school class, an office...) has seen the first part of a series the eiever mass will increase else it will decrease (I said rule of thumb).

    With the internet and everyone having email the equivalece would probably be something about how many % will forward it to friends ...
    -chs

  110. Re:Do it in Assembly by magores · · Score: 1

    Ahem...

    When I started all we had was one abacus for the entire crew.



  111. Re:Servlets are pretty good, I would question MySQ by face411 · · Score: 1

    FYI, Anything that mysql currently "lacks" will probably show up at some point. Until then, I can get a mysql server up and running in under 5 minutes. Anybody out there set up and configure Oracle in that amount of time lately? If you want RAD, mysql/PHP/apache is the way to go. Anyway, Oracle just released migration tools for MySQL so they must know that SOMETHING is up.

    I have not seen a scripting language run faster than php. The functionality "out of the tarball" with this language is almost ludicrous. On the fly PDF and image creation, XML capabilities, tons more (check out http://www.php.net). PHP can spawn ANY non-interactive process written in whatever language you like and get the output from a redirected file (or have the process dump it to the DB).

    PHP is one badass swiss army knife.

    --
    # face411 # # writing the bash script to suck your soul #
  112. Re:Servlets are pretty good, I would question MySQ by face411 · · Score: 1

    But for web scenarios it is UNPARALELLED because of it's speed IMO. Sure, you don't have row-locking, but you can at least develop your app without paying $$ for a commercial DB license. It seems the common definition of "mature" is that for something to be mature, it needs to suck up 90% of your machine's resources even when there is nobody connected to the DB. It's about as hard as changing a light bulb to connect PHP to another DB when the time comes. If you develop using MySQL, you won't even have to change your SQL much (if at all).

    --
    # face411 # # writing the bash script to suck your soul #
  113. Re:JSP + Servlet + EJB = Heaven by face411 · · Score: 1

    On that note: Is there anybody alive that can actually decipher a Java Run Time Error?

    --
    # face411 # # writing the bash script to suck your soul #
  114. Re:Bash! by face411 · · Score: 1

    Um... Two words

    Forked Processes!

    --
    # face411 # # writing the bash script to suck your soul #
  115. Re:Analyze, Design then Code by slashdogdick · · Score: 1

    Actually, Tcl might be just the ticket -- when it's embedded in the server itself and not run as CGI or fast-CGI.

    These poor fellows need to look at jettisoning Apache altogether in favor of aolserver (www.aolserver.com), which provides speed, scalability, choice of language (C and Tcl), and choice of database backends.

  116. True Server-side speed by bziman · · Score: 1
    For server-side scripting results that blow Java, Perl, and C out of the water, your best bet is to go with the MS QBasic interpreter. If you're set on compiled code as the way to go, you'll have to settle for COBOL.

    Sorry, I just hate these "my language is better than your language" arguments. Anything can be coded for speed and anything can be coded to suck.

    It's not Perl that makes Perl based sites suck -- it's the fact that CGI scripts spawn a new process every time they are called. More advanced server side scripting languages use a single process to handle requests. I'd personally like to see a Perl CGI gateway that doesn't have to spawn a new interpreter everytime.

    Frankly, I think ASM will have the same problems that you'd see with Perl -- the overhead is not execution of the script, it's the initial setup time for each request.

    Remember, if high performance was just a matter of switching to a faster language, we'd all be using that faster language. Usually it's something else that makes it fast or slow.

    --brian

  117. Re:Do it in Assembly by 3-State+Bit · · Score: 1
    Machine code? Geez, you wanna go part-time on us, you just say the word...

    I hand-filed gears, sprockets, cogs and pistons for my own Babbage Difference Engine, arranged for shipping for thirteen metric tonnes of high-grade coal from China, and blew my own glass cooling jackets from Nova Scotia beach sand. The result is the fastest goddamned shopping cart program on the net.

    Wheels and gears? Bah! I have ancient texts filled with speels and incantations to do my problems. Other answers can be found in tea leaves, wax, reading sticks tossed on the ground, or in tarot cards.

    TAROT CARDS! absolutely BRILLIANT! Once you get beyond a certain range, you can have a 55-billion-row database you're querying, and your TaRot (R) (from Monty Carlo, Inc) component serving you the result in linear time will outperform on a 286 what ten clustured Quad Xeon machines are crunching through in ten times as long! No caching, no scanning, no nothing. Pure speed. Sir, I applaud you.
  118. Re:Esperanto! by 3-State+Bit · · Score: 1

    Ha!

  119. Re:Esperanto! by 3-State+Bit · · Score: 1

    Esperanto--the universal language!

    Oh, you meant programming language.

    [Man, what a bitch it would be to try to code in Magyar...]

    This is not as difficult as it seems. Hungarian actually developed from the C language group. (That's why it's not an indo-european language).

    Here is a typical letter,
    3#15#2001
    intmain Barat,
    Intmain baratom++ [hung. for !--helps against lameness filter also] Hogy vagy+?+?+? En jol; [hungarian for .
    " is hungarian for a comma, >> and <<, as in French, for quotations]. En nagyon jol vagyok "koszonom" de nem ertek egy dolgot a leveledbol; Hiszen "irod" >>nem ertem a leveledet<< "holott en nem kuldtem egyaltalan neked levelet; e-mellet "ha kuldtem volna" meg vagyok gyozve hogy ertheto lett volna++;
    Egyelore ennyit; haliho+
    This letter, copied literally, does not illustrate the hungarian use of { and } for paranthesis before large clauses and longer paragraphs.
    Other aspects of Hungarian orthography are not of interst.

  120. Re:Check out Amiga Virtual Processor language by shibboleth · · Score: 1

    Have you seen any benchmarks for VP? I didn't see any at www.amiga.com, just an interview and a tutorial on it with fairly vague speed claims.

    --
    "Be thankful you are not my student. You would not get a high grade for such a design :-)" - Minix pro
  121. Re:C or C++ Is probobly your best bet by NonSequor · · Score: 1
    If you really need to you can always use inline assembly with C or C++.


    "Homo sum: humani nil a me alienum puto"
    (I am a man: nothing human is alien to me)

    --
    My only political goal is to see to it that no political party achieves its goals.
  122. Re:Don't do it in Java by FrostedChaos · · Score: 1
    No. Java is slow. There are fundamental reasons for this, such as the fact that it uses covariant subtyping and is effectively interpreted.

    Oh, and did I mention that it's interpreted (yes I know it is also compiled too, that's not the point here.) Interpreted languages are slow. Think BASIC.

    --
    "Any connection between your reality and mine is purely coincidental." -Slashdot
  123. Perl, Zeus and Velocigen by Elgon · · Score: 1
    Zeus with velocigen is far, far faster than apache with mod_perl I believe: Unfortunately Zeus ain't free but it is a complete piece of piss to use, is secure and is the fastest webserver there is, by quite a long way.

    Elgon

  124. Re:Language choice by Xpresso85 · · Score: 1

    PICO FOREVER!!! (hehehe)

  125. Re:Don't do it in Java by byronbussey · · Score: 1

    it is the slowest


    --



    The surest way to make a monkey of a man is to quote him. --Robert Benchley
  126. Re:Do it in Assembly by einhverfr · · Score: 1
    Yes, but then you are losing the speed. Why not write a kernel-level extension to TUX using Assemply. That would be FAST.

    Seriously, I have been very happy with PHP. It has proven easy to maintain and code as well as a stellar performer where dynamic content is concerned. Read more at http://www.php.net.

    --

    LedgerSMB: Open source Accounting/ERP
  127. Re:Servlets are pretty good, I would question MySQ by tim_maroney · · Score: 1
    If the number of users is as high as stated (five figures), then the lack of row-level locking in MySQL is going to make it a performance nightmare for this application. Postgresql would almost certainly be a better choice.

    Tim

  128. Re:Servlets are pretty good, I would question MySQ by tim_maroney · · Score: 1
    With users in the tens of thousands, access conflicts are going to be the rule rather than the exception. With no row-level locking, that means the database is almost always locked when you want to access it. That means bad performance.

    Tim

  129. You're asking the wring question. by PhipleTroenix · · Score: 1

    I think we all know that assembly is the fastest. Unfortunately that is probably not the answer you were looking for, so you must have gotten the question wrong. Either that or you're just a troll.

    --
    When VPNs are outlawed, only outlaws have VPNs.
  130. Re:4 Web Scripting Languages Compared - PHP + Cach by Anthony+Boyd · · Score: 1

    Somebody mod up the post I am replying to. He's got links to tests and actual numbers and his own testing as well. This is good. I would love to see this study re-done using JRun for the Java implementation and Zend for PHP. I think both technologies would come out better. But clearly, this disproves some other posts here saying that PHP isn't so fast. Surprising.

  131. Re:JSP + Servlet + EJB = Heaven by HaiLHaiL · · Score: 1

    By adding "EJB" to the mix, you're limiting them to paid software (unless someone can tell me about an Open Source EJB container?). As far as Servlet environments go, if you're looking for speed, make sure you use Apache/JServ, not Jakarta Tomcat. Tomcat supports newer specs, but JServ is a tried and true fast servlet environment. Despite Java's general sluggishness, on good hardware it will get the job done.

    --


    reech bee-yond ur clip-0n
  132. Re:Yes compilers are faster. That's why there's RI by raju1kabir · · Score: 1
    Naturally, with a large game you can't keep everything in memory, but just by keeping the most frequently used things in memory you should be able to increase performs. Once somebody logs in, store their relevant info in a Bean. I have been brainwashed into using Java as the solution, but I'm sure you could do it in another language like C++ or Perl. But I don't think it can be done in a scripting language such as PHP, ASP or Python.

    Sure it can (in PHP, anyway). Just use a memory-based session handler (rather than the default disk-based one) and keep all the user-specific information there.

    As an added bonus, you'll have the entire application developed while the Java people are still waiting for all the floating windows on their IDE to come up.

    --
    "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
  133. Re:Analyze, Design then Code by Curro+Lopez · · Score: 1

    Basically, I agree with everything. Two comments here:
    - If you REALLY need speed, don't even use a database. Use plain files with your own format optimized for the queries you will make.
    - If you are going to implement your own web server (this will probably be my choice), try SGI's State Threads Library.
    http://oss.sgi.com/projects/state-threads/
    It's really fast and easy to use.

    Hope that helps.

  134. Re:JSP + Servlet + EJB = Heaven by Petrophile · · Score: 1

    I've taken a look at the WebLogic .java file output from JSPs, and there really isn't anything in there which is glaringly inefficient, except for the fact that every output gets run through some munging method.

    But, your point stands that if you are coding for performance, you better fully understand what the JSP engine is doing.

  135. Re:JSP + Servlet + EJB = Heaven by bay43270 · · Score: 1

    I would like to add my two cents... At my last place of work, we had a very nice alpha (6 64bit 700 mhz processors, 4 GB ram, 4tb of disk space) - it hauled. It ran True64 (Compaq's unix). The only VM available for it was FastVM (also written by Compaq). They claimed it to be the fastest around. Compaq claimed it compiled the code down to machine code before running it. I can't tell you how slow this thing was. I was embaressed for java, until I realized it was just the FastVM. The same programs would run three times as fast on my 450mhz PC (running hotspot). Now, you have to take this with a grain of salt. I didn't do any valid testing. I just ran our programs on both machines, and my PC smoked the alpha. I understand Compaq was porting hotspot for the True64 os. So this shouldn't be a problem anymore.

  136. Re:JSP + Servlet + EJB = Heaven by EllisDees · · Score: 1

    Strange idea of heaven. JSPs are possibly the *slowest* platform I have ever seen. Development is slow, deployment is slow, and execution is slow. I've been developing JSPs and servlets for 2 years using VisualAge and WebSphere, and you do not want to use these products on anything that needs to be fast. Sure, they might be scalable, but only because they start out so slow that they can't get much slower under heavy load. Look elsewhere for speed.

    --
    -- Give me ambiguity or give me something else!
  137. mode the text above up by onepoint · · Score: 1

    He's got 2 good links.



    spambait e-mail
    my web site artistcorner.tv hip-hop news
    please help me make it better

    --
    if you see me, smile and say hello.
  138. php can handle high loads if optimized. by Anomymous+Coward · · Score: 1

    what i can suggest, from playing around with multiple languages (jsp, perl, python, php) on FreeBSD/apache, is to use php optimized with zend's optimizer.... the speed boost is about 15%, and if apache is configured correctly, or even patched for speed, php will outperform any other similarly prepared language.

    --

  139. Re:Not ColdFusion or ASP by russmay · · Score: 1

    Darn right. I have done just that, and it is far better solution than ASP+VB.

  140. Re:PHP4/Postgres (really!) is your best bet by AX.25 · · Score: 1

    Truthly Mysql does not scale. Mysql fails under heavy load using large tables (600k to 1M+ rows).

    --
    What is pirate software? Software for inventory of stolen treasure?
  141. Check out Amiga Virtual Processor language by APC-tcm · · Score: 1

    Amiga's virtual processor language is portable and usally faster than native apps. I know you won't believe me, so check it out for yourself - http://www.amiga.com.

    1. Re:Check out Amiga Virtual Processor language by APC-tcm · · Score: 1

      I'm an Amigavangelist. You actually expect me to have evidence to back up my claims? ;-) Acutally, I'm just a fan, so I haven't taken the time to really investigate it. And I'm not a programmer yet (and if so, I would with a scripting lang. like PHP), so I can't run my own tests. But I do believe the claims. It's based on Tao's VP, which appears to have a lot of respect.

  142. Re:Real comparison by psycho_tinman · · Score: 1

    Great article... I think Java has probably improved with 1.3, but hey, this is on Solaris, after all... so, I guess its fair.. I'd tend to think that Perl 5.6 is slightly faster than 5.005xx as well... no reason really.. just 'feel' like its running faster ;o)

    but on the whole, a very interesting article.. but this won't make the Java language purists budge, even after they see it... :o)

  143. Re:Servlets are pretty good, I would question MySQ by 3am · · Score: 1

    i was going to suggest postgre - i agree that mysql isn't really mature as far as dbms go.

    --

    A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
  144. Re:JSP + Servlet + EJB = Heaven by CrackElf · · Score: 1

    Ok, well, let me use a better example then. I began using java with powerj. It will drop a lot of code in for you and the code is very inefficient, for instance it uses strings instead of string buffers in an append to create a string situation. Since a string re-creates every time, the overhead is significantly different. I assume ( note: i have not looked at compiled JSP's) that some of the things that JSP's do are equally as inefficient. (and i have read a confirmation of that somewhere too, but that was 2 years or so ago, and i dont rem the source:)
    -CrackElf

    --
    "Blake is an idealist, Jenna. He cannot afford to think." - Kerr Avon, Star One, Blakes 7
  145. Re:JSP + Servlet + EJB = Heaven by CrackElf · · Score: 1

    Yes, that is true, but, because of the 'compiling' in which some canned code is used, rather than instance specific code, you get a product that is marginally less efficient. Of course it is possible to prog a servlet badly, and create more overhead.

    Like, when you compile c++ into machine language, the compiler is replacing your commands with a series of machine language commands. The series of commands is not as efficient and fast as programming in assembly even though they are all technically 'machine language' once compiled.

    -CrackElf

    --
    "Blake is an idealist, Jenna. He cannot afford to think." - Kerr Avon, Star One, Blakes 7
  146. Re:JSP + Servlet + EJB = Heaven by CrackElf · · Score: 1

    a jit compiler is just a gimmick, i saw benchmarks in the computer shopper (confirmed by someone doing a thesis related to efficiency / speed in java) that showed that if you take the benchmark from the begriming of the jit compiler's run, not from the begriming of the program's execution after the jit compiler has ended, the times are about the same in your average program (not iterative intensive programs)
    -CrackElf

    --
    "Blake is an idealist, Jenna. He cannot afford to think." - Kerr Avon, Star One, Blakes 7
  147. Re:JSP + Servlet + EJB = Heaven by CrackElf · · Score: 1

    Point. I conceed. :)

    -CrackElf

    --
    "Blake is an idealist, Jenna. He cannot afford to think." - Kerr Avon, Star One, Blakes 7
  148. Re:Look for the bottleneck first... by luniac · · Score: 1

    On a hunch ... I would guess that your DB server is the bottleneck. If you've already coded in C, you're not going to get much faster than that (certainly not an interpreted language like perl, php or JAVA)

    Consider (if possible) ditching the DB server altogether and going with some other type of shared storage. Also, look through your C code and consider optimizing it.

    I've actually been working on a game that's similar to what you describe, using php as the UI, MySQL as the data server and C for the event processing routines. The major bottleneck is the MySQL server, and I've been toying with writing some sort of daemon to serve out the data to the other programs to replace MySQL. SQL is very fast and it's great (the flexibility and rapid development can't be beat) but it's just not fast enough for a game like that under heavy load.

    Developing your own data engine will be time consuming, but if you MUST have the speed, that's the only way you'll get it.

    Unless, of course, you just buy tremendiously powerful servers. Try moving the DB server onto it's own machine with REALLY FAST raid drives and tons of RAM. That might speed things up enough.

  149. Well, for benchmarks..... by nate1138 · · Score: 1

    Check out This page for some benchmarks on web languages. The results are not what you'd expect from a perl page...

    --
    Where's my lobbyist? Right here.
  150. C or C++ Is probobly your best bet by benii · · Score: 1

    I would reccoment doing it in C or C++ because they're both fast and much easier to maintain than assembly. (which will always be faster) Some other languages would be easier to program in but if you just looking for speed go with C/C++.

    --
    one thing i can tell you is you got to be free
    1. Re:C or C++ Is probobly your best bet by johnnyb · · Score: 2

      Actually, the best would be in assembler as an Apache module. Apache modules are nice in that they don't have to be forked/execed - they just run right in the Apache process.

    2. Re:C or C++ Is probobly your best bet by joto · · Score: 2
      Nope it isn't. Hand-coded assembler will always win. A human can look at the assembler output from the optimizing compiler, find one spot to improve, and win. Also, by coding in assembler, you will often find some tweaks and clever tricks that it would be hard to describe in a high-level language, and that requires modification of the algorithm used, and therefore will never be discovered by an optimizing compiler.

      It is a misconception that compilers are now so good that people can't beat them. If most programmers had spent as much time with assembler as they do with high-level languages, most programmers would easily beat an optimizing compiler.

      But of course, writing anything substantial in assembler is just stupid. Almost as stupid as having this discussion, which also reduces (at leaast my) productivity...

    3. Re:C or C++ Is probobly your best bet by grammar+nazi · · Score: 2
      Why stop there?

      Assembler CGI scripts IMO are the fastest most efficient web scripts that you can write.

      You can write them because I wouldn't want to write Assembler CGI scripts, but they would be efficient.

      --

      Keeping /. free of grammatical errors for ~5 years.
    4. Re:C or C++ Is probobly your best bet by BlowCat · · Score: 2
      It's a common misconception that Assembler is faster than C. Good compilers know how to group instructions together so that they execute faster on the given processor. It's quite hard to do by hand.

      Compilers are not so dumb as in the times of 8088, and the processors are not so simple anymore.

  151. Be carefull with statistics.... by famazza · · Score: 1

    A regular fireman has a building in flames, then he called the super-math-man...
    The super-math-man did his math things and told the fireman that he would need exactly 1569 liters of water to stop the flames.

    Then he called the Cmdr-physics...
    The Cmdr-physics did his physics and math things and told the fireman that he wolud need aproxim. 1600 liters of water to stop flames.

    Then he called the Captain-enginneer...
    The Captain-engineer took a flight all over the place and told the fireman that 8000 liter will be enough.

    Then he called the All-mighty-statistic...
    The All-mighty-statistic asked him: "How much Water do you want to spend?"


    So, be carefull with statistics. And keep using C/C++!

    --

    -=-=-=-=
    I know life isn't fair, but why can't it ever be un-fair in MY favor!?
  152. Re:Not just language... it's all in implementation by Valdier · · Score: 1

    I have been using orion server since it was beta 0.52, and trust me, the benchmarks are real, if not a bit conservative. Most of the benchmarks he has gotten over the years are from users that hae tested and then compared to his own. When working for ELN(the isp) we did a ton of benchmarks between orion using servlet/JSP and half a dozen other servers including AOL server + TCL, Apache + CGI/Perl/JSP/Servlet through Jrun, IIS with ASP and orion with Jsp/Servlet. Orion consistently beat them hands down, and it is *cheap* for what you get. Ok, so that must sound like a sales pitch but it's very true.

  153. Re:Don't do it in Java by gchanot · · Score: 1

    I get the impression most /. users have used Java. I think it's the best language to program in, and it isn't slow. check out http://www.aceshardware.com/Spades/read.php?articl e_id=153 for some fast 3D java fun, check out http://leaf3.com/3d/RealSpriteApplet.html

  154. Re:Don't do it in Java by gchanot · · Score: 1

    I obviously meant to say "most /. users *haven't* used java" ;-)

  155. Re:C or C++ by Alex+Belits · · Score: 2

    I know, how fast it runs. I wrote an HTTP server, and in its early versions file-sender was a constantly restarting CGI-like process, like in FTP. Performance significantly increased when I have switched to process pool model, so I have added module interface that allows modules to have their own process pools when necessary, isolating modules from each other.

    --
    Contrary to the popular belief, there indeed is no God.
  156. C or C++ by Alex+Belits · · Score: 2

    As a module, of course -- either Apache (native or through or fastcgi) or my fhttpd (that I wrote with protocol that looks a bit similar to fastcgi, but allows more complex processing models).

    --
    Contrary to the popular belief, there indeed is no God.
    1. Re:C or C++ by The+Dev · · Score: 2

      You might be surprised how fast and how little memory a C language CGI runs. Of course if
      you are doing lots of DB queries each instance, you would benefit from a persistant app.

  157. Bash! by Nate+Fox · · Score: 2

    May I suggest using a shell interpreter of some type? I like bash, but csh may be your calling since you guys have some C/C++ background. Forget the PHP/Perl/Python thing. Just use the URL and/or cookies to store variables! No need for a database, either! I say make the client do all the work. :-D

    -----
    If Bill Gates had a nickel for every time Windows crashed...

  158. Re:Language choice by Christopher+Craig · · Score: 2

    ed is the standard text editor, after all.

  159. Re:Not ColdFusion or ASP by sheldon · · Score: 2

    Out of curiousity, were you trying to write monolithic applications using thousands of line of VBScript within ASP?

    Or were you doing the intelligent thing, writing all your logic into compiled VB/VC components configured within MTS and then called by a few dozen lines of ASP code?

    There's more to it than that, but...

    Can you say DUH?

  160. Re:mod_perl mod_php by Christopher+Cashell · · Score: 2

    Actually, both mod_perl (available from ActiveState) and mod_php (as of PGP version 4+) are available for Win32 now.

    Check out ActiveState's web site for the perl module, and php.net for the Win32 binary download.

    Of course, it's been my experience that both run much better in a Unix environement.

    --
    Topher
  161. Esperanto? Then JSP or Esperant by Pseudonymus+Bosch · · Score: 2

    Some people that call themselves the esperanto group use JSP and Corba.

    Since we are joining database languages and Esperanto, I'll mention Visionyze's Esperant, a tool for generating database queries, but there are no promises of speed.

    __

    --
    __
    Men with no respect for life must never be allowed to control the ultimate instruments of death.
    GW Bu
  162. Re:More to Speed than Language by quoll · · Score: 2
    OK, for raw speed I'm going to keep clear of scripted languages and leave that to others...

    Yes, Java can be very fast, especially with some of the latest Hotspot JVMs. In fact Java can be faster than C++.

    C is generally much faster than Java. C++ can be just as fast, providing you don't use certain constructs, such as virtual functions. If you do then you will be slower than Java on Hotspot.

    Of course Assembler is the fastest if you concentrate on the coding (as others have pointed out). However, this becomes quickly infeasible if a group of programmers are working on the project. A good compiler is MUCH better to use. Hence you should just use assembler for bottlenecks (meaning that you're pretty much stuck with C/C++. Let's not get into JNI).

    As for the framework, others have pointed out the cost of CGI. mod_almostanything will probably be faster than the tightest assembler (depending on the ratio of hits to the complexity of the task). For sheer invocation speed, you can't go past modules. That usually means Java or a scripting language, but there's nothing to prevent you from writing the program as a binary module.

    So it's an engineering decision between trade-offs.

    • If the program is long and complex enough then the cost of CGI is probably small. If instead, it is a simple program then modules will allow for more hits.
    • If you want a module then is the time and complexity of writing a binary module in C or C++ worth the speed advantage provided over scripted or Java modules?
    • If you go with a module framework then will Java really provide the speed increase over mod_perl, mod_php, etc, that you want? Some tests here are in order.
    • If you use CGI (because the application is complex enough that invocation cost is negligible) then will the OO advantages of Java and C++ make it worthwhile for the team to program in these languages? Otherwise C is the fastest option (with assembler tuning of bottlenecks).
    • If using CGI and you choose Java or C++, then are you after code-reuse, etc? If so then you're possibly going to use the C++ features that make it slower than Java. Alternatively, C++ also allows for easy Assembler optimisation of bottlenecks.

    If speed outweighs everything, including complexity, development time, cross-platform issues, and cost, then I recommend building your own Apache module in C and optimising bottlenecks in assembler. If complexity, development time, corss-platform, etc, are still important, then I'd probably go with Java with a fast module, but I'd do some performance tests first.

    All of these languages are great (including the scripting languages I haven't mentioned), but they need to be used where they are most appropriate.

    Just my 2 bits worth.

  163. Re:JSP + Servlet + EJB = Heaven by acroyear · · Score: 2

    http://openejb.exolab.org/ is an opensource EJB2.0 container.

    --
    "But remember, most lynch mobs aren't this nice." (H.Simpson)
    -- Joe
  164. Re:JSP + Servlet + EJB = Heaven by The+Mayor · · Score: 2
    Yes, but using gcj eliminates all of the benefits of JSPs. Namely, you loose the benefit of having a common JVM across multiple calls to the code. This means you can't pool objects (JSP does this automatically) or pool resources, such as database connections (DB pooling comes for "free" with J2EE implementations, such as the free one from JBoss).

    All told, if you pick a decent JSP/Servlet engine (JRun or Resin perform about 3x better than Tomcat), you'll find the JSPs run just a hair (about 10%) slower than the fastest dynamic page systems, mod_perl & mod_php. With the object oriented benefits of Java, and the ability to separate presentation logic from business logic using JSP tag libraries, JSP/Servlet engines are an excellent choice.

    By the way, I wouldn't discount ASP+, either. While ASP has a lot of problems, ASP+ has learned from a lot of previous mistakes, as well as from all the benefits achieved from JSP/Servlets. Of course, it will tie you in to MS solutions (bad! bad!), but it's a very good piece of technology, none the less.

    --
    --Be human.
  165. Re:JSP + Servlet + EJB = Heaven by The+Mayor · · Score: 2

    So you compile your app server with gcj? OK. So I suppose you need an open-source app server. Try JBoss, or Enhydra. Ooops. They both depend upon libraries that gcj doesn't support.

    OK. Let's say you get past that hurdle. So now you want to rework the servlet framework so that they are compatible with .so libraries. Hmmm. Why you're at it, why don't you simply rewrite an HTTP server that loads these mythical .so servlets? Your suggestion is ridiculous.

    Apps can't tell if they're running natively vs. running in a VM. But the servlet spec depends upon a dynamic class loader. And, lo and behold! gcj doesn't support that (a dynamic class loader is different than a shared archive, I'm afraid).

    --
    --Be human.
  166. Re:JSP + Servlet + EJB = Heaven by Mad+Browser · · Score: 2

    The link: JBoss.

    Whoops.
    -Hunter

    --
    RateVegas.com - Vegas Reviews
  167. Excellent Post [OT] by alienmole · · Score: 2

    Excellent post, thank you. It's Insightful, Interesting, Informative, and Underrated!

  168. Re:Well Duh by SheldonYoung · · Score: 2

    Even assuming developers can even agree what a "reasonably intelligent" program is, I don't think most applications are reasonably intelligent, if for no other reason than design goals change.

    For example, what they have right now may have been a great design if it was intended for a small audience. Small, simple and fast. But if the goal shifts, all of the sudden the current design is no longer right, even though it's still "reasonably intelligent".

    Even assuming two similar designs, the language doesn't make that big of a difference. Even going from the slowest to the fastest is only a factor of two or three. And if it's only a factor of two or three generally the effort is better spend on hardware, which speeds up everything and not just one application.

    We live in an age of where orders of magnitude growth is common. This will change, but until then we have to plan for incredible growth and a simple language change alone isn't going to cut it.

  169. Re:Language choice by SheldonYoung · · Score: 2

    To make up for my transgression, and horrible editing in my post, I'll add my few:

    * We're running a site with a few million hits per day, and we're considering switching from Apache to IIS because we heard it was faster. Thoughts?

    * Should be move from BSD to Linux because we can by CDs at our local drug store?

    * Bruce Perens or Natalie Portman?

    * What's the better breakfast cereal: Hot grits or Glorious MEEEPT?

  170. Re:Look for the bottleneck first... by nchip · · Score: 2

    put the database and web server on different machines. then monitor which one get's more load.
    You will also wan't to monitor the amount of traffic
    between database and web server, in case you are
    "selecting too much" and prosessing too much in the cgi.

    --
    signatures pending - ansa@kos.to - (dont mail there)
  171. Re:Well Duh by AntiFreeze · · Score: 2

    Seriously, what kind of advice is 'use good design'? ... Given two reasonably intelligent programs, the choice of language makes a huge difference in the speed of an application.
    Umm, I think you're missing Sheldon's point. He's not really saying "use good design", he's saying "know your design first". This is vital when determining what language to code your program in.

    Chapter 3 of The Practice of Programming by Brain W. Kernighan and Rob Pike is devouted to exactly this kind of situation. Knowing how your project is/will be structured can help you choose the right language. This can also lead to shorter, crisper programs and more understandable code. Why write a simple one-line regexp in Perl when you can write the same thing in a few hundred lines of C?

    A program designed well but written in the wrong language can run horribly slowly. The same is true if you're using a language that you're not very familiar with. Use a language you know, and use a language which fits the design of your program. Taking these two things into account, I feel, yields the best results.

    So, I think the best solution comes when you add your comment with Sheldon's. Given two reasonably designed programs, the choice of the language makes a huge difference in the speed of the resulting application.


    ---
    --

    ---
    "Of course, that's just my opinion. I could be wrong." --Dennis Miller

  172. Re:JSP + Servlet + EJB = Heaven by lostguy · · Score: 2

    JSP's are pretty robust, but slower than pure servlets (which are also robust)

    ????

    JSPs are compiled into servlets. Admittedly, they may be slower than intentionally-coded servlets, but after the first call, they are servlets.

  173. Re:Look for the bottleneck first... by lostguy · · Score: 2
    I beleive the database server and other libraries that you call out to make a much larger impact in speed.


    We have an application constructed in a similar fashion: JSP/Servlet in the presentation tier, custom appserver for object persistence and business logic at the backend, talking to Oracle. Under load, the cpu profile was 70%/25%/5%.
    Apparently, all the string manipulation in the presentation layer (parsing requests and generating responses) had a much higher resource requirement than the pure-object or database components. Oracle wasn't even sweating, but we've worked hard not to make it do so, given the expense of JDBC.

  174. Re:Analyze, Design then Code by Malcontent · · Score: 2

    The only problem with this is that you need to deploy at least two maybe more languages. For the ASP pages you need to write jscript or vbscript and for you com objects you need to write them in C/C++ and then deploy them on MTS. You are most likely going to need two teams to do this project.
    Using Java or Mod_PERL you could do it all in one language and save the cost of the other team.

    --

    War is necrophilia.

  175. Re:Analyze, Design then Code by Malcontent · · Score: 2

    I just wanted to point out that..

    You can write loadable modules for php in C. this gives you tremendous advantage of native C speed while using a scriptable interface with a very rapid developement cycle. The functions you write in C will be visible to the scripter like any other PHP native function. Combine this with the built in database pooling and you got a killer solution.

    If the PHP scenario is not scenario is not scalable go to webobjects. It's also a very roubust well tested easy to develop environment that handles scalibility for you. By using objective C you get compiled speed with a framework where all the hard work has been done for you.

    As long as you are thinking outside the box consider Klyx or Delphi. Go talk to the astatech folks and they will sell you the middleware from hell for a dirt cheap price. This thing truly rocks (I am not associated with them in any way just a happy customer). You get RAD developement, native compilation, great database support, ability to write apache modules, a killer IDE and debugger. Really now what else could you ask for.

    --

    War is necrophilia.

  176. Re:Yes compilers are faster. That's why there's RI by prizog · · Score: 2

    "With CISC complex instruction, often 1 long to execute instructive can get into the chip, and halt everything until it finishes."

    There are CISC machines with ILP. Pentiums have 2 pipes, and Athlons have (IIRC) 5.

    "Either way, the coder is only able to access the 8(AIX,BIX... etc...)"

    That's EAX, EBX, etc. But, there are more available: mm0-mm7 (which are really the floating point registers), and xmm0-xmm7, which are 128-bit registers for SSE and SSE2.

  177. But they don't have to develop, only port. by Ungrounded+Lightning · · Score: 2

    So if everyone really knows what they're doing (cross fingers), go with Perl, because you cannot get that much expressiveness in any other language. If you think your development skills would benefit from additional structure, go with C++.

    Generally good advice. But this is a special case.

    The questioner already has working code, and wants to recode it in another language to speed it up and perhaps "iron" it into cleaner form for future enhancements.

    In such a situation you can inherit much of the organization and concentrate on speed. Porting to a language that's enough different than the original to bring your attention to things as you port (rather than making a mechanical translation) but not so different that you have to totally reorganize or implement a LOT of of replacements for language builtins will probably give you the cleanest result. Or if you're already in the likely fastest target language, sit back and look over the existing organization to see what can be improved.

    C/C++ tends to be the fastest in those enviornments where it's appropriate, and IF you can find the right stuff in the standard libraries/class libraries you probably won't have to implement a lot of replacements. Let's assume for the moment it would be a good choice. Since this is a port for speed, it would be a good time to come to a real understanding of the underpinnings of the language, so you can squeeze the most out of it.

    But before you dig in, try instrumenting the existing system and find out where its bottlenecks are. You may find the real problem isn't the language, but some other aspect (like API delays or database time). If that's where your time consumption or latencies are, you'll have to fix or replace them to get your improvement anyhow. If the bottlenecks aren't inherent in the existing language (neither the language itself or its API requirements), you might find you can fix them and leave the bulk of the code just as it is.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  178. Re:Do it in Assembly by lizrd · · Score: 2

    Were you lucky enough that when you were finished you got to dump it to one of those comically large 8" floppy disks? Or did you have to output your results to paper tape?
    _____________

    --
    I don't want free as in beer. I just want free beer.
  179. Re:Look for the bottleneck first... by Alpha+State · · Score: 2

    I have a question: how do you test the speed of the script vs the database vs the web server?

    The main problem I have is knowing what the load looks like. Should I just pull back pages as fast as possible and measure CPU use?

  180. Re:Language choice by krmt · · Score: 2

    To "ed" simply reply "ex"

    That way you get all the vi people on your side by default as well. ;-)

    "I may not have morals, but I have standards."

    --

    "I may not have morals, but I have standards."

  181. mod_perl mod_php by Serpent+Mage · · Score: 2

    mod_perl and mod_php are most likely going to be your optimal solutions. They are very well optimized for large performances and the retain the code in memory for faster execution. In terms of perl, mod_perl is MUCH faster then FastCGI but there is a larger memory requirement. mod_php is IMHO the better way of going but then again, mod_php is only available on the unix platforms which defeat your cross-platform desires (I'm not sure if mod_perl is on win32 boxes or not). PHP alone is not capable of handling the demands that you are talking about but because of the way that mod_php caches and retains in memory the php scripts it is also a faster solution and you are having to make less requests to the harddrive which cause the minimal but neccessary speed increases. However, your overall best bet is to do some kind of content distributing and pushing the contents closer to the users regionally and/or server clustering is probably a must.

  182. zend costs by siculars · · Score: 2

    dont forget that zend costs in a commercial environment. that is where the speed lies with php. i would say write the whole thing in c and set it up as an apache mod. a good book is 'writing apache modules in perl and c', stein & maceachern, published by o'reilly. good luck.

  183. Re:Well Duh by Nyarly · · Score: 2
    And you should also try to write your software with fewer bugs. And if you're in a boxing match, try to land more punches than the other guy.

    The question though is analogous to a boxer wanting to know what gloves to use to win boxing matches. Maybe there's an advantage to lighter (or heavier) gloves, or a specific stitching, or the leather used or whatever, but the fact that the boxer asked the question suggests that maybe they don't know they should be landing more punches.

    So, the advice "use good design" is excellent. It's a tactful way of suggesting that the code they're using isn't all that crucial. Moving to a 5 figure user base (and congratulations to the article author) requires a better design, of which a production plan (of which language choice is just a part) is just a part. I think the best part of the advice given is that it doesn't sound as much like chiding a fledgling as it probably should.

    --
    IP is just rude.
    Is there any torture so subl
  184. Machine code or nothing! by swordgeek · · Score: 2

    OK, maybe an exaggeration. Programming in straight machine code will give you the fastest and tightest code...when you finish in 2007!

    C is probably the best compromise, but design is crucial--go read "Mastering Algorithms with Perl" or something similar to remind you how important GOOD coding for the situation is, rather than concentrating on the language.

    --

    "People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
  185. Re:Consider removing Apache by john@iastate.edu · · Score: 2
    Apache is a great general purpose web server, but if you really need all-out performance, it is not the answer.

    Probably the highest performance architecture for an all-dynamic-content site is a very small, simple, single-process httpd (say based on thttpd), which connects (via sockets, shared memory, or fd-passing) to one or more persistant server process(es) dedicated to your task (probably written in C).

    --
    Shut up, be happy. The conveniences you demanded are now mandatory. -- Jello Biafra
  186. eweek recently put php on top by avi33 · · Score: 2

    In the last 6 months or so, eweek had a shootout between scripting languages...php spit out 61 pages per second, i believe, putting it on top in the speed category, above asp and jsp. can't seem to find the article on their site tho...

  187. Not just language... it's all in implementation by Oroborus · · Score: 2

    More matters than just language. If you were running on an NT/2000 machine you would be best off using either ASP/COM or ASP.Net. (crippleware anyone?) But being on a *nix platform, you would probably be best off going with a Java servlet solution.
    Java and the J2EE not inherently any faster than any other technology, but has a huge advantage because of vendor support. Everyone's scrambling over eachother to provide the best and fastest implementation of the J2EE platform, and the results are trickling down to free servers.
    A good example would be the Orion J2EE server, which if benchmarks are to be believed is far and away the fastest solution. Find it at: www.orionserver.com
    I use it myself, and can vouch for ease of use and speed, though I haven't done any benchmarking.
    Check out some amazing benchmarking figures for it at: http://www.orionserver.com/benchmarks/benchmark.ht ml

  188. Re:Don't do it in Java by joto · · Score: 2
    Ooooh, we all bow in awe of your fantastic insight. Not bothering to listen to people with experience, or to back up your claims with any sort of benchmarks, you use the well-known technique of prejudice. Because Java is interpreted (which it isn't), and even though you admit it is not interpreted, then it is effectively interpreted. Not bothering to explain what this means, you go on to mention another language that you (wrongly) say is interpreted, namely Basic. Then, without mentioning dialect, or implementation, you want us all to "feel intuitively " that Basic is interpreted, and also that Basic is slow, and that therefore all interpreted languages are slow. Now, since Java is (by your claims) effectively interpreted, it must also be slow!

    I feel so in awe of your grasp of logic!

  189. Re:Do it in Assembly by joto · · Score: 2

    You'd have to be stupid, then. Perhaps you aren't stupid enough!

  190. Re:Yes compilers are faster. That's why there's RI by a!b!c! · · Score: 2

    First off, I just to need to reiterated that RISC stands for (Reduced Instruction) set not (Reduced Instruction set). The instructions are quick to execute. With CISC complex instruction, often 1 long to execute instructive can get into the chip, and halt everything until it finishes. I believe this is why overclockers get burned. But with RISC commands, the chip is able to quickly handle each one, and on most modern achitectures it is able to handle 3-4 RISC commands at the same time. It is able to re-order some of the assembly commands during runtime to maximize the number of things going on at once. Additionally, it is also able to optimize register allocation.

    I was recently told that the PII chip has 40 registers not 8. I believe the chip dymanically assumes and tries to optimize the best use of those 40 from 8 by looking ahead, but it *might* occur in the compiler, but that seems less likely. Either way, the coder is only able to access the 8(AIX, BIX... etc...)

    If the same register is being used for many commands, but the output of one command is not needed for a future command that uses the same register, the chip will switch the future command to use a different register. So mastery of assembly does not guarentee more faster programs, one also needs to know what chip they are working on, and how it will attempt to optimize the code.

    Yes, I'm offtopic but compilers are cool. Now for a lil on topic stuff. I come from the school that when hitting web pages the database hit tends to be the thing that slows things down. The solution I have used to solve this problem is to load the database in memory as much as possible. Max max max out the ram on yer server cluster, and fill up those javabeans. Naturally, with a large game you can't keep everything in memory, but just by keeping the most frequently used things in memory you should be able to increase performs. Once somebody logs in, store their relevant info in a Bean. I have been brainwashed into using Java as the solution, but I'm sure you could do it in another language like C++ or Perl. But I don't think it can be done in a scripting language such as PHP, ASP or Python.

    Worst episode ever.

  191. Re:Language choice by 0000+0111 · · Score: 2

    I could not agree more. I just spent 18 months developing high-speed online database access using binary CGI (not a script, but an executable). There are so many varieties of options available out there. After my first dev cycle I was very distracted by trying to find something faster. Spent a total of about four months trying to find better language/system/drag-n-drop solution. I found that they all have strengths and weeknesses. In the process I wound up completely redesigning my original CGI in it's original C and the end result came out way better than the other options could have done. It's way more than ten times faster after a good redesign. My only regret is that I wasted four months chasing a red herring. Also, as a result of redesigning it, I am intimately familiar with the entire system now. I also designed it so it scales easily. Just get another box and another IP. It even registers itself with the DNS. I haven't even turned on compiler optimizations yet. I'll save that for a rainy day. And then I'll hand roll assembly if I have to panic. Which won't happen because of the scalability. Which brings me to a point that I'd like to contribute. I find that it makes me a lot more comfortable to know that my code has room to improve so I can get it when I need it. As opposed to,"there's no way I can make the system go any faster. I already have it optimized as much as it can be".

  192. make it a module by aminorex · · Score: 2

    the speed solution is not to recode as a script, but to move the app from cgi to a loadable module.

    --
    -I like my women like I like my tea: green-
  193. Real comparison by avandesande · · Score: 2

    Here is a link to a pdf that has real performance comparisons between scripting languages and c/c++. It has productivity figures as well.

    --
    love is just extroverted narcissism
  194. Re:Analyze, Design then Code by John_Booty · · Score: 2

    You can pretty much eliminate any interpreted language (e.g. Tcl) and web script (e.g. PHP, ASP, ColdFusion).

    I wouldn't rule out interpreted languages, because you're not going to be doing any "heavy lifting" in them anyway.

    For example, with ASP, the goal is to use ASP *only* for formatting and user-interface. All the "heavy lifting" (ie, computationally expensive stuff) should be done in another tier, written in precompiled COM components written in C/C++ or some other language. Sure, ASP is slow, but if it's only doing 1% of the total work you're okay. Also, it's a good way to separate interface and design from the game logic.

    A similar strategy could be used with any interpreted language that generates web pages... Java, Cold Fusion, etc.

    http://www.bootyproject.org

    --

    OtakuBooty.com: Smart, funny, sexy nerds.
  195. Re:Esperanto! by seanmeister · · Score: 2

    [Man, what a bitch it would be to try to code in Magyar...]
    <P>
    Man, at first you said "Marglar" - now THAT would be a bitch!!<P>
    <TT>
    #!/usr/bin/marglar<BR>
    $marglar = "Marglar!";<BR>
    marglar "Hello there. What is your marglar?\n";<BR>
    $you = <STDMARGLAR>;<BR>
    marglar($you);<BR>
    marglar "Hello, $you. Marglar to $marglar.\n";<BR>
    </TT><P>(Slightly obscure South Park reference...)
    Sean

  196. Compiled: Specifically, Delphi, BCB, and Kylix by fm6 · · Score: 2
    if your also looking at using a traditional database behind the scenes then take a good look at Delphi / Kylix. Delphi creates the fastest web apps while still allowing applications to be developed quickly..

    I'm neither an expert on web development nor objective (I work for Borland). But this point needs to be amplified.

    TheCorporal wants RAD, as long as it doesn't affect speed. Delphi is the Windows RAD tool, and it generates tiny, fast native executables. Its Linux sibling, Kylix, is also fast and has a particular emphasis on Apache support. Both products suport apps-as-shared-libraries, so you get the extra oomph of an in-process server.

    Both have first rate database support, but plenty of Delphi programmers write non-database apps. I expect Kylix to be the same.

    Oh yeah, and if you want fast web apps, you want Internet Direct, AKA Winshoes. Now open source, works with Delphi and Kylix. Naturally, it's on the Kylix CD.

    You also get a fast change-and-test cycle. Both Delphi and Kylix use Pascal, a language that only takes one pass to compile. Plus the Borland Pascal compiler is the fastest on the block, being the current incarnation of the venerable Turbo Pascal compiler. So a Delphi/Kylix build is shockingly fast -- so fast that new users often think the compiler is simply broken.

    If you can't live without mulitple inheritance and operator overloading, Borland C++Builder is the way to go. Same technology, but of course compiling C++ takes a lot more work! No, I can't tell you when the Linux version will be out.

    I hear someone saying, "Yeah, but Borland won't be around in six months." I've been hearing that for 10 years! Enough already.

    __________________

    1. Re:Compiled: Specifically, Delphi, BCB, and Kylix by fm6 · · Score: 2
      I've heard that. Not my department, but I believe somebody is working on it. In the meantime the fix is available from the link I put in my previous post.

      __________________

  197. Use The Source by codepunk · · Score: 2

    Compile it into apache if you want to break speed records. Create a apache module to run your stuff and compile it right in. It is not goig to run any faster than that.

    --


    Got Code?
  198. Re:Language choice by wishus · · Score: 2

    heh.. when circumstances forced me to code on a windows box (not my choice), i used notepad.exe long enough to write my own primitive editor. then i used my new editor to make itself better. now i have a nice multi-document graphical editor with cut/copy/paste and find/replace with regexps.
    ---

  199. PHP/Zend is free! by mgkimsal2 · · Score: 2

    What do you mean zend costs in a commercial environment? The underlying zend engine used by PHP is free! The zend cache product costs money, but is definitely not needed by PHP, and there are free open source alternatives to boot. PHP/Zend is most definitely free in commercial settings. We've got loads of them running, and didn't need to pay a dime in licensing fees.

  200. Go with experience by JWhitlock · · Score: 2
    The fastest language in execution speed will probably be the one your programmers are most familiar with. C or Assembly would be the fastest when optimized, but it is also possible to code a really slow implementation. If your programmers start with a language they are familiar with, then learn a bit about optimizing that language, then they should do alright.

    Having said that, it sounds like several languages would support your application, and different ones would be best implemented in different languages. A glue language with calling ability to other languages (C, C++) may be good for the central parts, and farm database work out to a database language (MySQL). This way, you can take advantage of speed gains in either domain (C++ speed optimizations for low-level execution, MySQL for quantum database improvements).

    This will also force you to think about the design a little more, as well as the interfaces. With good interfaces, the implementation can thrash around a bit, but everyone can still be doing their work, and you can prototype a lot faster.

    Of course, I haven't experienced your situation. Why don't you write the developers at Utopia, see what they use, and if they would change anything about their language of choice?

  201. Ok.. by PHr0D · · Score: 2

    Lets not forget about fortran!.. Oh, you said for the web.. right.. *cough*.. Oh look, here comes my bus..


    --------------------------------------

    --
    --------------------------------------
    Vices - what I lack in originality, I make up for in volume.
  202. Re:Yes compilers are faster. That's why there's RI by Jamie+Webb · · Score: 2
    When I have a really critical piece of code, I write it in both C and assembler, then look at the compiler output and mix and match.

    I generally come up with a more efficient overall representation of the algorithm, and can do other optimisations based on extra knowledge, and the compiler comes up with a better way to use registers, etc.

    The combined code is usually about 15% faster than either of the originals.

  203. Re:JSP + Servlet + EJB = Heaven by Martin+Spamer · · Score: 2

    I agree, Java has to be a serious contender for your short list, the portability/platform independence will be a serious advantage longer term.

    When you consider the convergence between STB's,Consoles and Web-Pad; Java is the only realistice platform for these, and medium term you'll get support for plenty of other client devices, for very-little or even no effort.

    The ability to use the same language across the development, on the server side and a range of clients, will make resourcing the various elements of the system easier. All your Coders can work equally well on any of your tiers, Server, middle or Client.

    Some will disagree claiming Java is too slow, however this is not really true, ( I use Java to implement an Interactive Digital TV service).

    This is especially the case when compared with the realistic alternatives, particularly server side.

    The very light-weight nature of Java threads make it highly responsive (low latency) compared to CGI processes. Add a decent JIT and this means it can even out-perform C/CGI.

    Java skills are pretty common and increasing, (and look good for your CV :)

  204. Re:Do it in Assembly by 3am · · Score: 2

    hell, do it in 0's and 1's....

    REAL SOFTWARE NEEDS TO BE TESTED!!!

    most software shops can't realistically develope in assembly. it's simply to difficult to trace bugs in the code, and there are too many ways for bad developers to shoot themselves in the foot. odds are that the percentage gain they'd get in performance from coding in assembly would be offset by the time/cost of writing the software.

    Whatever it's written in, good design is most important anyway.

    All being said and done, it sounds like you should write it in c++ with an optimized compiler for the best performance, although java servlets or a java server would be the easiest to write, and quicker to develop without losing too much performance.

    --

    A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
  205. Re:JSP + Servlet + EJB = Heaven by CrackElf · · Score: 2

    Errr, I have been coding in java for the last 2.5 yrs, and I have to say, java has some advantages, but it has some pretty serious drawbacks as well:
    anytime use java, you loose speed. JSP's are pretty robust, but slower than pure servlets (which are also robust), applets (over the net) tend to be slow, because it takes an age and then some to download a medium sized applet, and EJB's (the last time I used them) were less than reliable.
    the advantages of the design, implementation, deployment, and reusability / consistency are all valid.
    -CrackElf

    --
    "Blake is an idealist, Jenna. He cannot afford to think." - Kerr Avon, Star One, Blakes 7
  206. Re:Don't do it in Java by jfryer · · Score: 2

    Bollicks. Java GUI runs like a 3 legged lame pig in mud, but java sever side code (which obviously does not need GUI in it) runs comparable in speed (if not fast in some cases) to c++ server side code. Plus it is easier/faster to code and maintain.

    --
    ------------------------------------ There is no magic, only Onions Pug conDoin ----------------------
  207. Re:Do it in Assembly by ---s3V3n--- · · Score: 2

    As of win32 I thought C++ was just as fast as Assembly.

  208. Re:Don't do it in Java by gchanot · · Score: 2

    OK, let me try again!

    Java vs C

    Java 3D applet

  209. Re:Do it in Assembly by root · · Score: 3
    Machine code? Geez, you wanna go part-time on us, you just say the word...

    I hand-filed gears, sprockets, cogs and pistons for my own Babbage Difference Engine, arranged for shipping for thirteen metric tonnes of high-grade coal from China, and blew my own glass cooling jackets from Nova Scotia beach sand. The result is the fastest goddamned shopping cart program on the net.

    Wheels and gears? Bah! I have ancient texts filled with speels and incantations to do my problems. Other answers can be found in tea leaves, wax, reading sticks tossed on the ground, or in tarot cards.

  210. Re:Do it in Assembly by PCM2 · · Score: 3

    I concur. But you should point out that developer efficiency is a good thing as well. For rapid application development, he should seriously consider using a wire-wrap kit, rather than etching the circuit boards himself.
    --

    --
    Breakfast served all day!
  211. Re:Do it in Assembly by ewhac · · Score: 3

    Assembly? Geez, kids these days. Back in my day, we entered machine code directly, entered in octal by toggling address and data switches on the front panel and hitting DEPOSIT NEXT.

    Schwab
    (Better mod this down; "Can You Top This?" cascades can get out of hand...)
    (And no, I'm not kidding, I really did fiddle with IMSAI and Altair boxes...)

  212. Some data points by Lumpish+Scholar · · Score: 3

    See:

    "An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl"

    Kernighan and Pike's The Practice of Programming (reviewed here), especially chapter 7 on performance

    This comparison (just popped up from a Google search).

    Obvious advice: Measure your current system, find out where it's really spending it's time.

    If programmer productivity is irrelevant, you'll be hard pressed to beat well-written C. (And if wishes were horses, beggars would fly.-)

    --
    Stupid job ads, weird spam, occasional insight at
  213. Re:JSP + Servlet + EJB = Heaven by jilles · · Score: 3

    And the people who do realize don't realize they are not addressing any performance bottlenecks by using it. Get over it, native compilation does not solve many Java performance problems. There's a reason for native compilers such as towerJ and gcj not being used that often: the performance gain is not that big and sometimes not even there!

    --

    Jilles
  214. PHP by austad · · Score: 3

    PHP is fast and runs on just about any platform. With the use of the ADODB abstraction layer, you can easily switch databases if needed instead of changing a ton of code. It has built in session management, but you can easily store your session data in your database, then you can just add identical servers as your load goes up, and you don't have to worry about connection persistence across servers, so it's extremely scalable.

    If you add the Zend optimization engine, it's even faster if you're doing alot of loops and such.

    --
    Need Free Juniper/NetScreen Support? JuniperForum
  215. Moto by hugg · · Score: 3

    There's a language called Moto that compiles directly into Apache C modules. If you cache your database calls properly, you can get supposedly get 1000's of hits per second. Probably not for everybody, but if you need extreme speed... you need it!

  216. Re:Do it in Microcode by SEWilco · · Score: 3
    Better yet, design your own microprocessor for the game and write the entire thing in microcode.

    Well, it certainly makes for fast software development time when the entire program is:

    RUN
    HALT
    But the firmware development and maintenance will take some time.
  217. Algorithm Design is the Barrier, not Language by Ted+V · · Score: 3

    Having spent 10 years developing software, let me assure you that your greatest speed gains come from the algorithm design, not the language used.

    The best example I have is from 2 years ago when I worked for Motorola. I wrote a simulator that performed a large file with a real device on the other side. The simulator was also responisible for multithreading other tasks from the real device at the same time (although the program only used one unix thread to do this). We wrote our simulator in Perl and the actual device ran compiled C code.
    It turned out that our interpretted Perl code sent packets to the C program so fast that the hardware running the C code crashed. We literally had to cripple our Perl code so it sent the data at a slower rate.

    That said, I firmly believe that it's far more important to choose a language that best suits your development abilities and choose language speed second. C++ and Java are great languages if you want to be forced into object oriented development, and sometimes that's what you need. Personally I love perl, but learning how to write clean perl code is extremely difficult (though rewarding).

    So if everyone really knows what they're doing (cross fingers), go with Perl, because you cannot get that much expressiveness in any other language. If you think your development skills would benefit from additional structure, go with C++.

    -Ted

  218. PHP4/Postgres (really!) is your best bet by stuce · · Score: 3

    There was an article here on slashdot that compared four different scripting languages. From the standpoint of speed PHP came in first. PHP has a reputation of being the fastest web scripting language and, to be honest, is a joy to program in as well. If this is not enough speed Zend sells a PHP cache that will precompile all your pages to speed things up even more. I believe there is a free version of the PHP cache out there but I don't know it by name.

    And before you use MySQL please read this. MySQL has a reputation of being the fastest open source database but it really can't scale like Postgres can.

  219. Servlets are pretty good, I would question MySQL by smoondog · · Score: 3

    If your tables are *huge* MySQL may not be
    the best solution, not sure on performance
    but it is something to check. Your language
    is not the only thing you need to consider. You should also consider the DB engine and the server platform. Why recode when you can purchase more hardware? :) Might be cheaper.

    Servlets are quick, well supported and popular.

    -Moondog

  220. Re:Language choice by shaper · · Score: 3

    * Is there any kind of text-mode visual editor on unix ?

    Must resist... must resist... Ahh, to heck with it, the obvious answer is

    vi, of course. :-)

    FLAME ON! Ducks, runs...

  221. More to Speed than Language by cs668 · · Score: 3

    People say java is slow. I can write really fast Java code :-)

    It really depends on how well you know the language and environment you are working with. If you pick up java and go to town it might be slow, same with perl, or C. As an example you are trying to change your C execution environment by using FastCGI. Has nothing to do with the language C but, the way that the client comunicates with that C code.

    You need to come up with a good plan from front to back and then pick the language or languages that will make it happen.

  222. Not ColdFusion or ASP by tokengeekgrrl · · Score: 3
    I have worked with both of them and they are both resource hogs. They work fine if your traffic is somewhat limited but neither scale very well from my experience.

    And I would definitely consider upgrading the database to something more robust than MySQL.

    - tokengeekgrrl

  223. Speed is relative by Darlok · · Score: 3
    The question you're asking about what is the fastest CGI language is sort of a loaded one. Different languages excel at different things. Will you be accessing a relational database (which one?), will there be only one server or will it be load-balanced over several, etc etc etc? Heaven forbid you're storing something of this magnitude in on-disk flat files, but if you are, well, that needs to be considered too.

    PERL is multipurpose, but won't win many road races for much of anything. PHP has ease of use, but its database support (even with pconnect) and performance in general is not the quickest unless you're hacking the Zend optimizer by hand. Python is getting closer, but it's still not the fastest. ASP isn't either.

    You're identifying the right problem, but IMHO, asking the question wrong. I'd identify and measure the speed of your underlying technology first. Depending on what you're doing, the script may not even be the bottleneck! (Though it's hard to say with the amount of info provided.)

    Either way, good luck!

    --
    Notice: Your mouse has been moved. Windows will now restart so this change can take effect.
  224. Re:Don't do it in Java by joto · · Score: 3
    Well, that's pretty scary. I don't have the report here at home, but I'll certainly look it up later. However, from my experience Java is certainly not such a hog. While the JIT enthusiasts might be overdoing it a bit (sometimes even claiming performance is better than C++), the java-bashers (wow, there I go ad hominem again...) who usually only rely on prejudice are a lot worse. Until I've actually read the article, I presume this must be a very extreme case that they were lucky to find in the JIT implementation (and that would easily be spotted by a profiler, so that it could be rewritten).

    My experience with Java is limited to some (very minor) work on a very large data-acquisition system (and I really do mean large, both in terms of code and in terms of data. Sure we had some performance problems, most of them due to programmer faults, some of them due to scale of the project (the previous version was written in C++, and had performance problems as well, and here we experienced the all too typical second system effect), and some few extremely annoying problems with the java implementation. Mostly related to garbage collection.

    Well, to be true, we didn't really use java for the data-intensive stuff, but it was pretty amazing what we found orselves doing in java. Often prototype implementations turned out to be good enough, and never needed a rewrite in C++. The main realization was that java is certainly not as slow as some people would have it. A rule of thumb would probably be 2-3 times slower at worst (unless we are talking about swing, which really is a hog), but this was two years ago, and the situation might have improved even more.

    I am not a big java bigot. But that's not because of performance. I'm perfectly happy with java's performance (although such extreme cases as you pointed out definitely needs fixing). What I don't like about java is mostly syntactical (it's too much like C/C++, and it doesn't allow you to use macros for abbreviating common constructs). I also miss complex numbers, generics, and easier interfacing with code written in C, C++, assembly, or Fortran. What I do like about Java is that it usually results in readable code (surprisingly often, don't really know why...), relatively ok performance, garbage collection, and javadoc. Which basically means that java probably would be one of my favourite choices for a language when working as part of a large team, or taking over someone else's code, but not for my personal hacking pleasure. Hmmm, come to think of it, that's a pretty good recommendation, but I think I still prefer Ocaml, Beta, Common Lisp, Smalltalk, Mercury, Haskell, C, Python, or Ruby for hacking pleasure...

  225. Answer + Pool by f5426 · · Score: 3

    Put it in the kernel. Writing it in assembly would be a plus too.

    Okay, this is a stupid answer, but the question was stupid already:

    > we feel it is time for a recode

    The pool:

    "Everything is running like crap. You've got a cold feeling". What is it?
    * time for a recode ?
    * time for an ask slashdot ?
    * time for an upgrade ?
    * time to check that the 'turbo' button is pressed ?
    * time for hiring good engineers ?
    * time for a profiling session [<- hint] ?
    * CowboyNeal ?

    Cheers,

    --fred

    --

    1 reply beneath your current threshold.

  226. Re:Do it in Assembly by Saint+Aardvark · · Score: 3
    Machine code? Geez, you wanna go part-time on us, you just say the word...

    I hand-filed gears, sprockets, cogs and pistons for my own Babbage Difference Engine, arranged for shipping for thirteen metric tonnes of high-grade coal from China, and blew my own glass cooling jackets from Nova Scotia beach sand. The result is the fastest goddamned shopping cart program on the net.

  227. Re:JSP + Servlet + EJB = Heaven by baka_boy · · Score: 3
    The biggest problem that I have with JSP/Servlet/EJB development is that very, very few people using those APIs actually do a decent job of implementing a "great OO design," and all the additional overhead built in to the J2EE platform just bogs the thing down. The whole point of the J2EE spec is to create an environment in which the programmer can't screw up a transaction, write non-thread-safe (or even multi-threaded) code, or hack together their own improvised patch for a certain type of database, browser, etc. You might as well be writing in Cold Fusion for all the freedom and flexibility you get.

    For a really large application, with dozens/hundreds of developers, hundreds of thousands of users, and millions of transactions being processed regularly, the over-engineering of the J2EE framework can pay off. For anything that totals less than about 50,000 lines of code, or that doesn't need a lot of built-in industrial-strength transaction processing and legacy system integration, though, it's just overkill. And every time your JSP wants a single variable from an EJB, something like the following happens on the backend:

    1. Client makes request for http://someserver/content/dyn_page.jsp?sessionId=" xjfoi490fijs"&username="foobar"...
    2. Web server forwards request to J2EE app server
    3. App server checks security context, last update time of JSP source file, request data, etc.
    4. JSP, running as a servlet, receives the request data
    5. The output contains a value pulled from an EJB, so a JNDI lookup and CORBA call is performed to locate the EJB server
    6. A stub proxy for the EJB is loaded, and a CORBA connection is opened between the servlet and EJB servers
    7. The method request is made, and its result is serialized, passed over IIOP to the servlet container, and deserialized
    8. Finally, the servlet finishes writing the output, and returns control to the web server, which replies to the client

    And yes, in theory J2EE apps are portable between application and web servers, as well as underlying operating system. However, that assumes that every vendor supports the full spec, (which almost no one does) that they use the same version, (which they certainly don't) and that the developers can resist using any of the oh-so-tempting add-ons, native libraries, and convenience methods that each of the app server vendors dangle in front of them.

    Finally, JSPs are just about the biggest letdown of any dynamic web tech I've used. They actually discourage the seperation of static content, dynamically-updated portions, and application logic. You get an equal amount of support for OO design in ePerl, and have to jump through far fewer hoops. If you want compiled "add-on" components, use the Apache module APIs (in C, Perl, Python, etc.). Both the development process and the finished application will be faster and easier to maintain, and won't require a wall of brand-new Sun Enterprise boxes to run.

    And yes, I know of which I speak. My last major programming project was a J2EE-based web application that, though fairly well optimized (with a lot of quick shortcut code, PL/SQL procedures handling much of the business logic, and Apache providing all of the static content) could bring a brand-new four-processor Sun to its knees when all ten people in the office tried to "load test" it.

    My advice to those who want a high-performance web application toolkit is to do what developers have been doing for a long time: find a starting point that already does some of what you need, and build on it. Don't drop $50k on a license for WebLogic if 85% of its functionality is going to go wasted.

  228. Well Duh by vodoolady · · Score: 3
    And you should also try to write your software with fewer bugs. And if you're in a boxing match, try to land more punches than the other guy.

    Seriously, what kind of advice is 'use good design'? I've heard so many people spout this pretty obvious goal as wisdom, and then go on to point out that stupid solutions run slowly now matter what language you use. Given two reasonably intelligent programs, the choice of language makes a huge difference in the speed of an application.

  229. the quickest solution by mongooze · · Score: 3

    while cgi is fine and dandy, the absolute quickest solution would be to generate a collection of static html pages for every possible combination of variables... granted this could take some time ;)

    --
    -- "Flying is the art of falling and missing the ground"
  230. Re:Consider removing Apache by acroyear · · Score: 4
    Yeah, that thought just crossed my mind. You can use the apache module API to make a module, in C, C++ (recommended), or Perl (using mod_perl as the means) so that requests don't leave Apache's memory space. The CGI slowdowns are 1) starting a new process (if needed), 2) passing data to the process, or 3) "interpretation" of a scripting language (whether in a separate process/memory space or embedded in apache).

    Writing your own Apache module will get rid of 2 of those three, and the third if you stick with C/C++ for your module. Note that you should still follow good design principles; the mod_whatever should just be a mechanism for getting data into and out of apache and the code that implements your application. The module is not the application; its the means to get apache to exchange data with your application.

    --
    "But remember, most lynch mobs aren't this nice." (H.Simpson)
    -- Joe
  231. Do it in Assembly by SpanishInquisition · · Score: 4

    it is the fastest
    --

    --
    Je t'aime Stéphanie
  232. Go Compiled by Natak · · Score: 4

    Well if you want top speed you can only get that from a compiled development platform. Most web environments have grown up as an interpreted solution in order to make changes easier (good old internet time). So if you care most about speed you want to look at a couple options, first is creating your own ISAPI if you're looking at NT, or your own DSO if your looking at apache. You can code either of these in C, if your also looking at using a traditional database behind the scenes then take a good look at Delphi / Kylix. Delphi creates the fastest web apps while still allowing applications to be developed quickly. There are tradeoffs if you look at a compiled approach. (Like you have to restart the web server if you make a code change). There are many inbetweener type solutions you may want to look at like ASP, or FastCGI.

  233. Have you done profiling? by Anonymous Coward · · Score: 5
    It's obvious from your post that you have no idea where the bottlenecks are. Before you go making arbitrary changes, do some real profiling of your app. What does gprof say? What does your network testing show? How much time is spent in each component?

    Without real tests, your changes are likely to have little or no effect on overall performance.

    Texas: all your electricity are belong to us

  234. Good design is fastest by mo · · Score: 5

    Although it's nice to speed up your program execution with changes like cgi to fast-cgi, good design will benefit you the most.

    What's a good design? Write your code in a way that you can run it on multiple servers with a web redirector in front of it. Try not to depend too much on fancy SQL logic as it is diffucult to scale your databases. Instead, try to stay out of the database as much as possible, and when you do have to use the database, split up your schema such that it wouldn't be that hard to run multiple database servers. Another good thing to keep in mind in MySQL is not to do too complex of queries. MySQL flies with simple selects on indexed fields. Extremely complex updates can really tie up your database.

    Now that you understand good design, how do you code your cgi end? For ultimate speed, you could do apache modules written in C, but mod_perl is only trivially slower and much easier to develop. One stipulation is that if you are getting deep into the guts of apache with things like internal redirects or many layered handlers I'd advise using C, but it doesn't look like you'll be doing that.

  235. Re:JSP + Servlet + EJB = Heaven by the+red+pen · · Score: 5
    I'd like to combine this recommendation with the other high-rated recommendation about design.

    Many "web languages" are page-centric. PHP, and ASP are like this. Other "web languages" take application languages and tie them to a page-centric mode. Mod-perl does with as does ASP+COM. For a lot applications, this isn't really a problem because the application flow maps nicely to the page flow. When the application does things which can be presented on a web page, but whose behavior is not easily modelled in a page-view manner, then you start to see kludgy implementations.

    Java allows you to code in a manner appropriate to the part of the problem you are solving. If you have, for example, a game-play engine that runs in the background, you can easily spawn a Thread for it that will run just like any other Java Thread without any limitations due to being a "web program."

    This allows a design where the game engine is nicely abstracted and isolated from the front end. This also makes it easier to have a team of people in charge of making the game cool for users and another team making the gameplay itself cool.

    On a side note, EJB's can impose a lot of infrastructure and programming overhead that's unecessary if you don't need the services of a full-blown Component Transaction Monitor. You can frequently do what you want by using regular Java classes or Java RMI.

  236. Consider removing Apache by acroyear · · Score: 5
    It all depends on what you're serving. If there's a lot of static pages, or pages in different languages, then Apache is the best mediator involved. This is certainly true of serving unchanging images.

    But if everything you do is going through the equiv of "CGI", then forget Apache. HTTP is far too easy a protocol to implement (hell, its the protocol used for lots of "embedded" servers in stuff like Napster and Shoutcast). Implement your own HTTP server where you automatically can have all requests go to an engine for processing directly, and take Apache and all that configuration out of the loop. You'd effectively have two servers running -- an apache server to handle throwing images and static pages around, and a second home-grown server that directly serves up the application data. Doing this won't change that your database engine is your primary bottleneck, but it will reduce all other bottlenecks by quite a bit.

    Apache is a general purpose system, and does it pretty damn fast, but for a true special-purpose system, its best to implement your own special-purpose server.

    The "embedded server" for Java follows the same principle. Maybe W3C has some implementation code in C that may prove useful.

    --
    "But remember, most lynch mobs aren't this nice." (H.Simpson)
    -- Joe
  237. JSP + Servlet + EJB = Heaven by Moe+Yerca · · Score: 5

    I don't know about speed numbers (everything I've done server side has been extremely fast) but development time is great with JSP/Servlet/EJB. It's easy to build a great OO design, implement it, and deploy it on gobs of web/app servers. It's really a shame Sun is giving Java such a bad name around hard core GNU/Linux peeps. It's such a pretty, robust, fun environment to code in. Try it. You'll like it. Or you'll vomit.

  238. Language choice by SheldonYoung · · Score: 5

    In reality, language choice has much less of an impact on the speed of an application than the design. but Even a language that's twice as fast can be ten times as slow with a bad design. Some languages make certain designs easier to express, just pick a language that lets you design the way you want.

    The *first* thing you need to do is make the design is right. No matter how fast the language is, the number of new users and new features will outstrip any incremental improvements. Even if you make it three times as fast eventually there will be three times as many users.

    The only lasting solution is to design it so it scales. If you don't, you'll be chasing the increasing loads by praying incremental optimization and faster new hardware will keep you ahead of the curve. If you build a successful site, it probably won't.

    Consider Slashdot a classic case to study.

    1. Re:Language choice by f5426 · · Score: 5

      You're spoiling the fun. It was the most trollesque askslashdot ever.

      They *asked* for a langage war.

      Next ones should be something along the line.

      * We're a big company porting its stuff to linux. What is the best desktop environment to use ?
      * When redoing out corporate backend, we decided to go to unix. But which unix should we choose ?
      * Is there any kind of text-mode visual editor on unix ?

      Cheers,

      --fred

      --

      1 reply beneath your current threshold.

    2. Re:Language choice by Erasmus+Darwin · · Score: 5
      vi, of course.

      Nonono. There is but one answer to the editor flamewar:

      ed

      If someone says, "vi", someone else will inevitably reply, "emacs".
      If someone says, "emacs", someone else will inevitably reply, "vi".
      If someone says, "ed", everyone else tends to get quiet and assume that the person is either a Unix guru, an escaped mental patient, or both. Either way, they realize that they probably shouldn't argue the point further.

  239. Yes compilers are faster. That's why there's RISC by Ungrounded+Lightning · · Score: 5

    It's a common misconception that Assembler is faster than C. Good compilers know how to group instructions together so that they execute faster on the given processor. It's quite hard to do by hand.

    In fact it's research to that effect, a few years ago, that led to the development of RISC machines.

    A good assembly programmer could still outdo a compiler when he really focussed. But the compilers knew MOST of the tricks, and applied them consistently everywhere. In competition with assembly programmers - even good ones - the program that had been through the compiler normally came out significantly ahead.

    Given this, and the greater portability of things like Unix (which was mostly in C with some minimal assembly where needed), assembly code was mostly dropped except where it was unavoidable (like OS routines to get the stack arranged after an interrupt so you could get back into C).

    But given that the compiler was generating essentially all the code anyhow, it made sense to design computers with simplified ("reduced") instruction sets, rather than extended ("complex") sets of feature-prone instructions. Sometimes it would take several RISC instructions to do the work of a CISC instruction. But the compiler could generate it, so it was no skin off the programmer's nose.

    With the compiler to do the work, a RISC computer could be very simple internally. This meant it could be very small. That meant the parts could be close together, so it could run faster with a given technology, and that it could be moved to a faster technology sooner, when the production yeild for a BIG chip was still too low but the yeild on a SMALL one was adequate.

    The extra instruction fetches were a problem. But instruction cacheing kept the inner loops in the machine, so there was still a big net gain.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  240. Analyze, Design then Code by fayd · · Score: 5

    Design is a major issue when talking performance, but there's more to it than that. The poster mentioned using MySQL on the backend. That means there's quite a bit of work to do before we even start mentioning design.

    Someone with a fair understanding of data analysis needs to go through and figure out what the data storage needs are. Now pick your database: MySQL is reasonably fast for small databases on small machines. But it reaches its breaking point relatively quickly. My experience indicates that PostGreSQL is the next step up the ladder. With a user base in the 5 figure range, I would run Postgres on it's own machine and watch it closely. If it seems to have problems keeping up (and you're not on too small a machine) you'll have to start looking at a big database (e.g. Oracle).

    Also, the other hardware you're running on has some performance implications. Do you have a large amount of physical memory? The more information you can keep in memory, the faster your system. How are your disk file systems layed out (NFS? RAID?). The when you do have to go to the file system, these having resolved these questions will affect performance.

    Now we can talk about languages and delivery mechanisms.

    You mentioned keeping an eye towards portability. Unfortunately, there are trade offs there as well. If you want speed, portability is your enemy. Java and Perl are great languages (I use them and recommend them often), but they are relatively poor performers. You can pretty much eliminate any interpreted language (e.g. Tcl) and web script (e.g. PHP, ASP, ColdFusion).

    The heavy lifters are still C and C++. But even if you write your CGI in C, you're still incurring the CGI penalty (which is very expensive).

    If you insist on using Apache, then start by writing an Apache module in C or C++. Even faster than that is to skip Apache altogether and write the entire server yourself. You want this to be web delivered still, which is fine as the HTTP protocol isn't too difficult to implement.

    Once you've figured all this out ... NOW you can start your design.

  241. Esperanto! by TOTKChief · · Score: 5

    Esperanto--the universal language!

    Oh, you meant programming language.

    [Man, what a bitch it would be to try to code in Magyar...]


    --
  242. Look for the bottleneck first... by tweakt · · Score: 5

    Server side script rarely consumes a lot of processor cycles. I beleive the database server and other libraries that you call out to make a much larger impact in speed.

    It's all a matter of optimizing the slowest part for the largest gain. Optimizing the script will result in much less improvement than say, switching to a faster database server.

    Also next in line would be the web server that is hosting the application. Some scripting languages are possible more efficient than others but that only matters if you're doing a lot of processor intensive things within the script (mathematical calculations, etc) which is rarely the case.