Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2018-03-18 06:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (228 votes). Check out past polls.