Why does Perl use more resource than Php?

Discussion in 'Perl Misc' started by I Report, You Decide, Dec 23, 2003.

  1. A hosting service lungcapage has banned yabb, because it takes too much
    CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why
    perl sucks more resource of a server than php? i thought only mod-perl will
    suck not regular perl.
    I Report, You Decide, Dec 23, 2003
    1. Advertisements

  2. I Report, You Decide

    M Guest

    yabb != perl. Did the hosting service "ban" perl? That should answer your
    M, Dec 24, 2003
    1. Advertisements

  3. I Report, You Decide

    ctcgag Guest

    use Blatant::Liar;
    print "yabb was so much better that many more people were using it\n";
    print "so it consumed lots of resources\n";
    ctcgag, Dec 24, 2003
  4. It was a dark and stormy night, and I Report, You Decide managed to scribble:
    Do like I do - run user mode linux with root access for about the same price as a virtual ISP. Run whatever you like.

    See http://user-mode-linux.sourceforge.net/uses.html for a list of UML ISPs.

    Gregory Toomey, Dec 24, 2003
  5. the hosting corp does not bann perl, but banns yabb, because saying it takes
    TOO MUCH CPU/memory. i just wnat to know if the yabb problme is a perl
    problem or the problme of the yabb script only
    I Report, You Decide, Dec 24, 2003
  6. I Report, You Decide

    Sam Holden Guest

    If it was a perl problem they would ban perl, yes?

    But they don't ban perl, they ban a specific application that is too
    resource intensive for their machines.

    What that application is written in is irrelevant (if it was they would
    ban that language and not just the application).
    Sam Holden, Dec 24, 2003
  7. I'm not following you, Sam. A Perl app that means a large number of
    new processes, which I suppose is the case with a bulletin board, may
    well reach the limit as regards how much CPU a web host accepts,
    without the host necessarily having to ban Perl for smaller
    applications. And there may be other languages that require less CPU
    for a similar app, so the language may well be relevant.

    (mod_perl is sometimes useful in cases like this, but very few web
    hosts offer that option.)
    Gunnar Hjalmarsson, Dec 24, 2003
  8. This all sounds like yabb problem :)

    Seriously .... if you want to find out where the "problems" are with
    yabb, then run some benchmarks and find out. You could, if using a
    *NIX system, use the 'time' command to see which is using more cpu
    time. For a strictly Perl look at the situation, check out the
    various Devel modules to aid in finding out where yabb "bottlenecks"

    In general, this really isn't a Perl issue - it's one you're having
    with your host and is based upon what *they* have told you. Find out
    for yourself and then decide if *they* are right :)



    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.

    a fortune quote ...
    Bugs, pl. n.: Small living things that small living boys throw
    on small living girls.
    James Willmore, Dec 24, 2003
  9. I Report, You Decide

    Keith Bowes Guest

    That's strange. I would have thought that Perl would be more efficient,
    due to PHP being easier and having more modules that are included
    without invocation. But I guess it's possible that hard to read doesn't
    necessarily mean fast to run.
    Keith Bowes, Dec 24, 2003
  10. I Report, You Decide

    Erik Tank Guest

    Your arguement doesn't really make sense. I can write two programs
    (both in Perl) that do exactly the same thing and one will run like
    lightening with nearly no impact on the machine while the other will
    grind the machine to a halt eventually crashing it.

    Neither outcome is Perl's fault - it is the fault of the programmer
    who either wrote inteligent/effecient code verses code that has memory
    leaks, hogs resources, etc.

    Asking if Perl is slower or uses more resources that PHP is like
    asking if a Ford gets better gas mileage than a Toyota.
    Erik Tank, Dec 24, 2003
  11. [ Please do not top post! ]

    Now i'm confused. If you don't run your Perl program under mod_perl or
    something similar, it's compiled every time it's called. The
    compilation costs CPU. (Please correct me if I'm wrong so far.)
    Of course. But you can't do anything about the need to compile.
    The question in the subject line of this thread may not be possible to
    answer. But for a particular application area I really thought is was
    not only possible, but also advisable, to consider which programming
    language is the better choice out from various viewpoints - also CPU
    usage. If you guys disagree on that, I must have missed something.
    Gunnar Hjalmarsson, Dec 24, 2003
  12. I Report, You Decide

    Matija Papec Guest

    X-Ftn-To: Gunnar Hjalmarsson

    You shouldn't say such heretic words.. some other language being better than
    Perl.. bah, just wait and see which language you'll use in your afterlife if
    you keep on with such heresy (hint, devil likes Sun).

    Matija Papec, Dec 25, 2003
  13. I Report, You Decide

    Ben Morrow Guest

    This is not specific to Perl, it applies ti any 'scripting'-type
    language which is not precompiled. For instance, if you don't run your
    PHP program under mod_php or similar, it's compiled (or re-parsed, or
    whatever PHP does) every time.
    You can do many things: use mod_perl or fastCGI, compile to bytecode,
    write a separate server process that does most of the processing,
    write the program so as not to load modules unless they're needed...
    You are of course right in both cases :). In general, the question is
    unanswerable, except for generalities like 'well-written C tends to be
    faster' and 'Lisps tend to be slow'. In specific cases, language may
    make a difference: in particular, if your ISP provides mod_php and not
    mod_perl you should either switch ISP or use PHP. :)

    Ben Morrow, Dec 27, 2003
  14. Well, my impression is that web hosting providers tend to offer
    mod_php, while web apps written in Perl typically are reduced to CGI.
    That is probably a generally valid answer to the question in the
    subject line, btw.

    Following your advice would lead to Perl being marginalized (is that a
    word?) as a language for web apps. :(
    Gunnar Hjalmarsson, Dec 27, 2003
  15. The major difference there is YABB is flat file, phpBB uses a database.

    YABB is older generation software, YABBSe and now SMF replace that, in
    PHP with a database backend. Many message boards which use flat file
    are banned on a large number of hosts, including UBB, YABB, etc.

    Anything with a database backend, is (normaly) going to be much quicker
    and less resource intensive than a flat file version.

    Stewart Campbell CS2002, Oct 27, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.