From: "Gaurav C." Date: 2011-11-27T22:20:22+09:00 Subject: Re: Is high-speed sorting impossible with Ruby? Yong Li wrote in post #1033823: > This counting sort implementation is a great optimization you can do > to solve this particular puzzle. However, many Java implementations of > this still exceeds the time limit. > The solution there is to read in (and write out) in bulks (e.g. in a > 100k-byte array), to avoid too many calls to STDIN.gets which is very > slow. > Exactly! That certainly seems to be the part which needs to be optimized. Could you share a solution to this? What could we do to avoid too many calls to STDIN.gets (which is slow)? -- Posted via http://www.ruby-forum.com/.