This question may be too vague for a good answer, but my curiosity makes
me ask it anyway. I thought I read somewhere that perl is actually
faster than C for certain tasks. The vagueness of the question probably
lies in exactly what task, who writes the program, the size and type of
data, and a dozen other factors.

Specifically, I am writing a perl script to convert RTF to XML. I
downloaded a utility called unrtf, written in C, which converts RTF to
HTML, a somewhat easier task. I got depressed when I ran unrtf on
small files and saw that it didn't take *any* time. But when I ran it on
a big file of 1.8 megabytes, it actually took 6 minutes and 30 seconds.
My script only took a minute! (Hooray, after all this hard work, that's
a little encouraging to see!)

When I ran the same file through a java utility called majix, it took
over a minute. It is hard to say exactly, because majix supplies their
own timer, and this timer only starts when java starts processing the
documents, some 20 or 30 seconds after you launch it.

I had actually considered learning C++ to make my little script really
fast so that people would consider using it. I really doubt I would have
really gone through all that trouble, but now I am wondering if C++
would have given that much of a time advantage--if any at all.

Certainly, a perl script would be easier to maintain and debug.

Thoughs on how C, java, and perl compare on speed? 

(I know I did a little test with sed, a python script, and a perl
script, just changing the word "the" to "teh" in a huge file. Sed and
python took about he same time, while perl was six times faster.)

Paul



-- 

************************
*Paul Tremblay         *
*[EMAIL PROTECTED]*
************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to