Speeding up a program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kid joe

    Speeding up a program

    Hi.

    I'm writing a mail client that filters/manages mail according to a Perl
    script, and I'm having trouble with speed. What my mail client does is
    construct two large strings (char * 's) and send them to the perl
    interpretter using perl_eval_sv(); The first string is some initialization
    data, ie: $from is the from field, $subject is the subject field, etc, and
    the second char* is the user's script.
    Currently, both these scripts are being executed once per message, so when
    the mail accounts reach 1000 or so, things get rather slow, and I'm trying
    to speed this up.

    What I'd like to know is:
    # The first string simply tells the perl interpretter to assign some scalers
    to values. Is there another way of doing this without creating a script? ie:
    a function I can call to assign perl scalers to strings?

    # The user's script obviously doesn't change for each message. At the moment
    the perl_eval_sv() function is having to parse the string and convert it to
    something interpretable every time. Is there a way I can convert it to perl
    byte codes at the start, hence only parse the string once?

    Hope someone experienced in using the Perl C API can help me. Thanks.

  • Keith Thompson

    #2
    Re: Speeding up a program

    kid joe <spamtrap@spamt rap.invalidwrit es:
    I'm writing a mail client that filters/manages mail according to a Perl
    script, and I'm having trouble with speed.
    [snip]
    Hope someone experienced in using the Perl C API can help me. Thanks.
    You're likely to get better help in comp.lang.perl. misc or
    comp.lang.perl. moderated.

    --
    Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

    Comment

    Working...