Speeding up a program

Discussion in 'C Programming' started by kid joe, Jun 25, 2008.

  1. kid joe

    kid joe Guest

    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.
    kid joe, Jun 25, 2008
    #1
    1. Advertising

  2. kid joe <> writes:
    > 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_Keith) <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"
    Keith Thompson, Jun 26, 2008
    #2
    1. Advertising

  3. kid joe

    Dan Guest

    and I'm trying
    > to speed this up.


    Write it all in C?
    Dan, Jun 27, 2008
    #3
    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. Spamtrap

    Need some hints on speeding up

    Spamtrap, Aug 11, 2004, in forum: Perl
    Replies:
    1
    Views:
    363
    Jim Gibson
    Aug 12, 2004
  2. Troy

    Speeding up page display

    Troy, Jan 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    506
    George Ter-Saakov
    Jan 22, 2004
  3. OHM

    Speeding up pages

    OHM, May 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    348
  4. =?Utf-8?B?TWF0dA==?=

    Speeding up a DataGrid with XML

    =?Utf-8?B?TWF0dA==?=, May 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    459
    =?Utf-8?B?TWF0dA==?=
    May 20, 2005
  5. redgambit

    speeding up a program

    redgambit, Jun 28, 2005, in forum: Java
    Replies:
    8
    Views:
    462
    Roedy Green
    Jun 30, 2005
Loading...

Share This Page