Results 1 to 4 of 4

Thread: Question about writing perl subroutines in c

  1. #1
    Join Date
    May 2008
    Beans
    19

    Question about writing perl subroutines in c

    I have read about writing perl subroutines in c and plan to try it out.
    One question i need to ask is, by writing the subroutines in c does that mean my sub routines will run with c like efficiency?

  2. #2
    Join Date
    Jul 2008
    Beans
    1,706

    Re: Question about writing perl subroutines in c

    try it out...make a routine that does:

    get current time

    do large amount of math

    get current time

    print difference in time

    then run it in C and run it in Perl

  3. #3
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Question about writing perl subroutines in c

    Quote Originally Posted by 2weird View Post
    I have read about writing perl subroutines in c and plan to try it out.
    One question i need to ask is, by writing the subroutines in c does that mean my sub routines will run with c like efficiency?
    If you write it in C, you get the speed of C...

    Tempered by any Perl code you call, of course. But that may be negligible.

  4. #4
    Join Date
    May 2008
    Beans
    19

    Re: Question about writing perl subroutines in c

    For those who would like to know: I have done some tests and it turns out that on first time run c code takes longer than perl. On the Second time it runs faster.

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
  •