From: MiG Date: 2005-03-11T16:57:28+09:00 Subject: Re: very slow IO (STDIN.gets and puts) on Linux, ruby 1.8.2_pre3 So the solution is maybe to use getc and parse lines on my own... MiG Dne 10/3/2005, napsal "Florian Frank" : >MiG wrote: > >>test.rb: >>#!/usr/bin/ruby >>while gets >>end >> >>$ time ./test.rb < data.dat >>./test.rb < data.dat 11,51s user 0,31s system 86% cpu 13,598 total >> >> >> >> >Well, Ruby assigns the line string to $_, if you use gets that way. So >Ruby has to construct an object for every line. Perhaps PHP doesn't do that? > >-- >Florian Frank > >