From: Joel VanderWerf Date: 2008-09-03T05:06:37+09:00 Subject: Re: IO#write_nonblock(string, offset) useful? Roger Pack wrote: >> puts `cat /proc/#{$$}/status`[/VmRSS:\s*(.*)/,1] # 13292 kB >> Is there a reason other than saving memory and avoiding a #slice call? > > Those would be the reasons I'd consider it useful--to save on CPU and > RAM [since it would avoid having to create all those extra objects]. I > think that's what you were pointing out? It's just that those extra objects are fairly small, due to copy-on-write... just the 20 byte ruby RString object for each slice rather than a copy of the whole 1Mb string you are trying to send. They share the 1Mb string data. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407