Speeding up a program

K

kid joe

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.
 
K

Keith Thompson

kid joe said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top