Speed comparisons - LWP and database access

Discussion in 'Perl Misc' started by trashman.horlicks@btinternet.com, Jan 24, 2007.

  1. Guest

    Hi all,
    I'm writing a two-block application, the first in C++, and the second
    in perl (for cgi/webforms); at the moment, I am unsure as to whether to
    write the whole lot in perl because its easier :)

    I'd like to ask a few questions if possible:
    How fast is LWP compared to comparable C/C++ socket open,close,receive
    calls etc.? LWP seems to be a more compact way of doing parsing of URLs
    but how much latency does perl add to the speed overhead?
    Secondly, for simple MySql calls to open,close,read,write a database,
    how well does C/C++ compare to Perl ?

    TIA

    Paul
    , Jan 24, 2007
    #1
    1. Advertising

  2. Guest

    wrote:
    > Hi all,
    > I'm writing a two-block application, the first in C++, and the second
    > in perl (for cgi/webforms); at the moment, I am unsure as to whether to
    > write the whole lot in perl because its easier :)
    >
    > I'd like to ask a few questions if possible:
    > How fast is LWP compared to comparable C/C++ socket open,close,receive
    > calls etc.? LWP seems to be a more compact way of doing parsing of URLs
    > but how much latency does perl add to the speed overhead?


    I expect the http server you are talking to will add way more latency
    than any difference between C++ and Perl that you will see in this regard.

    > Secondly, for simple MySql calls to open,close,read,write a database,
    > how well does C/C++ compare to Perl ?


    Same thing, I'd expect the work that the database server had to do to
    handle your request would swamp any differences on the client side.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
    , Jan 24, 2007
    #2
    1. Advertising

  3. Guest

    Thanks!
    , Jan 24, 2007
    #3
  4. -berlin.de Guest

    <> wrote in comp.lang.perl.misc:
    > Hi all,
    > I'm writing a two-block application, the first in C++, and the second
    > in perl (for cgi/webforms); at the moment, I am unsure as to whether to
    > write the whole lot in perl because its easier :)


    Go ahead!

    > I'd like to ask a few questions if possible:
    > How fast is LWP compared to comparable C/C++ socket open,close,receive
    > calls etc.? LWP seems to be a more compact way of doing parsing of URLs
    > but how much latency does perl add to the speed overhead?
    > Secondly, for simple MySql calls to open,close,read,write a database,
    > how well does C/C++ compare to Perl ?


    I am inclined to join Xho in predicting that the time will be consumed
    elsewhere. The difference in time efficiency will be small. A Perl
    solution may take more memory.

    Independent of that, I'd suggest writing both parts in Perl. If it
    turns out (unlikely) that some part *is* a bottleneck, rewrite it
    in C++ or whatever.

    That may sound like an invitation to do part of the job twice, but
    the second time through most of the design is already done, it's
    just the implementation language that changes. You will also have
    a working prototype while working on the change, which is a big
    advantage. Most importantly, you'll do the change only with that
    part of the code that actually needs it.

    Anno
    -berlin.de, Jan 24, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. efiedler
    Replies:
    1
    Views:
    2,029
    Tim Ward
    Oct 9, 2003
  2. Chris...
    Replies:
    6
    Views:
    288
    Chris...
    Jun 16, 2004
  3. Damian

    XSLT speed comparisons

    Damian, Sep 27, 2006, in forum: Python
    Replies:
    21
    Views:
    1,168
  4. mk

    (silly?) speed comparisons

    mk, Jul 8, 2008, in forum: Python
    Replies:
    1
    Views:
    253
    Peter Otten
    Jul 9, 2008
  5. Weng Lei-QCH1840
    Replies:
    1
    Views:
    181
    Thomas
    Aug 15, 2003
Loading...

Share This Page