From: Joseph McDonald Date: 2002-09-24T02:30:01+09:00 Subject: Re: Speed up suggestions VF> Ruby: _wordList = open('/home/vince/fr_dict.txt', 'r').read.split('\n') VF> Python: _wordList = (open('/home/vince/fr_dict.txt', 'r').read()).split('\n') VF> Same thing really. Here are the outputs of time: VF> Ruby: VF> ruby/crosswords.rb 1.52s user 0.13s system 68% cpu 2.407 total VF> Python: VF> python/crossword.py 0.52s user 0.07s system 31% cpu 1.875 total This way shows ruby a tad faster: % 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. -joe