Professional Web Applications Themes

Can Perl be faster than C ? - PERL Beginners

Hi All, Are there instances/scenarios where Perl can really be faster that C/C++. (Do not include coding or design time here, consider only run-time)....

  1. #1

    Default Can Perl be faster than C ?

    Hi All,

    Are there instances/scenarios where Perl can really be faster that
    C/C++. (Do not include coding or design time here, consider only run-time).


    Sumanth Guest

  2. #2

    Default Re: Can Perl be faster than C ?

    Sumanth Sharma wrote: 

    Perl is implemented in C. It can only be as fast as C, assuming a
    competent C programmer.

    Randy.

    Randy Guest

  3. #3

    Default Re: Can Perl be faster than C ?

    Sumanth Sharma wrote: 

    Perl is implemented in C. It can only be as fast as C, assuming a
    competent C programmer.

    Randy.

    Randy Guest

  4. #4

    Default Re: Can Perl be faster than C ?

    On Tue, Apr 27, 2004 at 02:31:34AM -0400, Randy W. Sims wrote: 
    However, I imagine there are situations where a programmer who doesn't
    optimise for speed (or isn't a great programmer) will end up with Perl
    being faster in some situations, assuming the C that Perl is written in
    was done by a good, efficiency concious programmer. For example, it
    would be easy to come up with a less-than-tuned hash implementation in C
    that runs slower than somebody who just used Perl to do stuff with
    hashs.

    Whether this is realistic or not, I don't know.

    --
    Robin <net.nz> JabberID: <org>

    Hostes alienigeni me abduxerunt. Qui annus est?

    PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFAjgTMzTjgendttmMRAt0CAJ9SOm5/FxRHl5UD18WYi7+TUgjdsACfUNAw
    5zGBVEN2dCRBkO+EicBL5KI=
    =TgVq
    -----END PGP SIGNATURE-----

    Robin Guest

  5. #5

    Default Re: Can Perl be faster than C ?

    Robin Sheat wrote: 
    >
    > However, I imagine there are situations where a programmer who doesn't
    > optimise for speed (or isn't a great programmer) will end up with Perl
    > being faster in some situations, assuming the C that Perl is written in
    > was done by a good, efficiency concious programmer. For example, it
    > would be easy to come up with a less-than-tuned hash implementation in C
    > that runs slower than somebody who just used Perl to do stuff with
    > hashs.
    >
    > Whether this is realistic or not, I don't know.
    >[/ref]

    Definately. There was a book (I think it was "The Practice of
    Programming" by Kernigan & Pike) where some comparisons were made and
    perl actually came out ahead in some cases. Perl is highly tuned and
    very fast at many tasks. My argument was meant more as a logical
    argument: since perl is implemented in C, the C must be as fast as perl.
    In practice, things are never quite so simple.

    Randy.
    Randy Guest

  6. #6

    Default Re: Can Perl be faster than C ?

    Sumanth Sharma wrote: 

    Hello,
     

    Yes. Check out this URL for proof. :-)
    http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html


    John
    --
    use Perl;
    program
    fulfillment
    John Guest

  7. #7

    Default Re: Can Perl be faster than C ?

    Thanks John.
    I think I had seen some of those graphs.
    I was actually looking for this info at citeseer.org.

    "John W. Krahn" <org> wrote in message
    news:org... 
    >
    > Hello,
    > [/ref]
    run-time). 


    Sumanth Guest

  8. #8

    Default Re: Can Perl be faster than C ?


    On Apr 27, 2004, at 3:37 AM, John W. Krahn wrote: 
    [..] 
    >
    > Yes. Check out this URL for proof. :-)
    > http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html[/ref]

    Sorry to have missed this discussion last month...

    Another way of presenting the problem of
    comparing apples to banana's would be

    which is faster building one's cgi code in raw Perl
    or should I build it with mod_perl so that it compiles once
    and then just runs.

    So a part of the core issue of 'should this be in c89 or Perl?'
    is what are you really trying to solve.

    If the c-coder is not afraid of optimizing for the OS that
    the code is targetted for - then they can cut down on the
    overall size of their code at 'run time' in ways that
    Perl Coders can not do - since they need the ref_count
    and run time environment.

    Similarly there are tricks that the Perl Coder can
    pull off far faster and far simpler outside of the
    'canonical code' that will not require the ECR ( engineering
    change requrest ) to get routed ... As a specific

    Gee you want to fix that in the lex and yacc
    or should I just write the hack in Perl to do
    what needs to be done for this other app?

    and if you know lex and yacc, you know that the answer was

    "yeah, just pop the regEx in Perl it will be simpler"

    Whereas there is a lot of stuff that is much closer to
    the OS specifics that are easier to write and maintain
    in a 'c-code' source that one builds an XS module to
    expose to the Perl Coders as the compromise.

    cf: perldoc h2xs

    So use the correct Swiss Army Chainsaw on the problem.

    ciao
    drieux

    ---

    Drieux Guest

Similar Threads

  1. What's faster
    By Eric Brown in forum PostgreSQL / PGSQL
    Replies: 1
    Last Post: December 11th, 07:22 PM
  2. Make php faster?
    By Frank de Bot in forum PHP Development
    Replies: 2
    Last Post: October 9th, 08:18 AM
  3. DuplicateMovieClip goes faster and faster
    By sylvie in forum Macromedia Flash
    Replies: 0
    Last Post: September 30th, 06:11 PM
  4. why not faster
    By rjphoto in forum Adobe Photoshop Elements
    Replies: 17
    Last Post: September 15th, 05:00 AM
  5. Which is Faster?
    By Dan Manes in forum Macromedia Director Lingo
    Replies: 0
    Last Post: July 29th, 10:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139