Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re (tilly) 1: Perl speed VS. other languages

by tilly (Archbishop)
on Jan 15, 2002 at 09:36 UTC ( #138812=note: print w/replies, xml ) Need Help??

in reply to Perl speed VS. other languages

Yes, C executes faster than Perl.

But it is often easier to write better programs in Perl than C.

Hand the following problem to your co-worker as a problem. Anagrams are words which are the same except for the order of the letters. Write a program which takes a list of words (separated by newlines) on STDIN, and then prints out all of the different anagrams. (Tell him to make it case insensitive if he can, if he can't then don't worry too much about that detail.) Ask your friend to do it in C.

When your friend is done, have your friend compare his performance with the simple script that I threw together in 5 minutes and posted to Find anagrams. Take a reasonable sized /etc/dictionary and throw it at both programs.

For more advocacy about using Perl instead of C see Re (tilly) 1: Why Use Perl?. It is about web programming in particular, but many of the points apply to other environments.

  • Comment on Re (tilly) 1: Perl speed VS. other languages

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://138812]
and the shadows deepen...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2018-07-19 12:00 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (407 votes). Check out past polls.