From: Dave Thomas Date: 2000-12-16T14:53:28+09:00 Subject: [ruby-talk:7408] Re: Ruby performance question "Joseph McDonald" writes: > def park_readfile > h = Hash.new > file = File.new("keys") > while line = file.gets > h = Hash[*line.chomp!.tr!('=', ',').split(',')] > # do stuff here... > h.clear > end > end You could speed this up a bit more... you don't need the h.clear anymore, as you're creating the hash fresh each time around. Dave