perl vs C 
Author Message
 perl vs C

hi, i had to write little program for handling big file. (making some
changes, and sorting the big file.
my question:
would it be much faster when there would be a similar program written in C ?
I mean it's very confortable to write it in perl, but what's about the
speed?  C = double as fast? or almost the same?

(i'm thinking of a well wri{*filter*} C program)
thanks
calmar



Wed, 22 Sep 2004 22:08:13 GMT  
 perl vs C

Quote:
> hi, i had to write little program for handling big file. (making some
> changes, and sorting the big file.
> my question:
> would it be much faster when there would be a similar program written in C
?
> I mean it's very confortable to write it in perl, but what's about the
> speed?  C = double as fast? or almost the same?

Probably doesn't matter.  You can probably WRITE the
program faster in Perl but even that is not certain without
knowing you.

In theory assembler can be faster than C can be faster
than Perl, but for many tasks it just doesn't matter or Perl
may even be faster....

How can this happen?  Larry and others who wrote Perl
spent a lot of time optimizing the libraries so 'ordinary'
programmers would now have to spend extensive time
to exceed or perhaps even meet the performance.

Not that it cannot be done, but it takes works and skill to
really use a language at optimum speed.

Not to cut you but if you have never thought about
performance issues enough to answer the question for
yourself, the ODDS are that you should just write the
program in the language where you can complete the
job fastest or in which it will be the most convenient.

Bad programming in any language runs slow; good
programming in (almost) any language runs at least ok.

Herb Martin
Try ADDS for great Weather too:
http://adds.aviationweather.noaa.gov/projects/adds



Thu, 23 Sep 2004 01:09:32 GMT  
 perl vs C

Quote:

> hi, i had to write little program for handling big file. (making some
> changes, and sorting the big file.
> my question:
> would it be much faster when there would be a similar program written in C ?
> I mean it's very confortable to write it in perl, but what's about the
> speed?  C = double as fast? or almost the same?

If it's done just right, it's possible that the C program
could be slightly faster than the Perl program.  It's much
more likely that the C program will be several times slower.

I wouldn't bother with C unless I found that I just couldn't
meet the requirements with a higher-level language.  And then
I would use C++.



Sat, 25 Sep 2004 01:54:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Hot novel by CS professor, includes perl code

2. Australian FTP site for perl4.0 - escher.gallery.cs.unsw.oz.au

3. Soliciting views on PLs in CS education

4. how to be a CS major

5. An attempt to compare the performance of perl vs compiled perl vs C

6. Mouse vs. Shortcut vs Mnemonics vs Tabbing:

7. perl vs python vs icon

8. web.sql vs sybPerl/cgi vs ?

9. `` vs system vs exec

10. Ora vs Syb, CF vs Pl (my decision)

11. or vs ||, and vs &&

12. system vs exec vs piped open...

 

 
Powered by phpBB® Forum Software