On 9/20/07, Damian Steer <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Alexey Verkhovsky wrote: > > I've poked around logging a bit, and here is what I discovered. > > > > Writing to a File instance in JRuby is actually not too bad, until you > > set sync = true on that instance. With that, MRI writes 7 times slower > > (which is still fast enough), but JRuby does it 1000 times slower. > > I noticed that the other day when someone mentioned log issues on irc. > Great minds ;-) > > Looking at <http://www.ruby-doc.org/core/classes/IO.html#M002287> I > think I've got sync wrong. I assumed it was fsync, but it just means > don't buffer writes. > > Commenting out channel.force(false) in IOHandlerSeekable#sync feels > correct, and speeds up writes enormously. Does that look right? > > Damian
Yeah, I think it looks good too. flushWrite will write to the channel and is not a local buffer. We let FileChannel implementation (our OS basically) determine how to write it out and we are not maintaining a local cache in JRuby at that point. It is unclear how closely NIO FileChannel maps in behavior to underlying OS, but this seems like a step forward to me. -Tom -- Blog: http://www.bloglines.com/blog/ThomasEEnebo Email: [EMAIL PROTECTED] , [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
