From: gminick Date: 2002-09-24T03:06:32+09:00 Subject: Re: Speed up suggestions On Tue, Sep 24, 2002 at 02:30:01AM +0900, Joseph McDonald wrote: > % time ruby -e "_wordList = open('/usr/share/dict/words', 'r').readlines" > 0.21 real 0.18 user 0.03 sys > > % time python -c "_wordList = (open('/usr/share/dict/words', 'r').read()).split('\n')" > 0.25 real 0.21 user 0.02 sys > > but these are not identical since the ruby version now has the "\n" on > the end of each string. IO.read_and_chomp_lines() would be nice to have. You're not fair ;> As I said in other post, python also has readlines method, and it works faster than read/split method. -- [ Wojtek gminick Walczak ][ http://gminick.linuxsecurity.pl/ ] [ gminick (at) hacker.pl ][ gminick (at) underground.org.pl/ ]