Our File.sync is too over zealous
---------------------------------

                 Key: JRUBY-1374
                 URL: http://jira.codehaus.org/browse/JRUBY-1374
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.1
            Reporter: Thomas E Enebo
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.0.2, JRuby 1.1.0


Damian noted that channel.force (which we had in sync is forcing immediate 
filesystem action; while the documentation for sync in Ruby says we just flush 
our internal cache and let the OS commit.  I committed to trunk the removal of 
force from sync.  Here are my results:

{noformat}
require 'benchmark'

msg = 'blah' * 200

f = open('/tmp/foo', (File::WRONLY | File::APPEND))
Benchmark.measure { 10000.times { f.write msg }}
f.sync = true
Benchmark.measure { 10000.times { f.write msg }}

# After: real   0m7.269s
# Before: real  0m1.512s
{noformat}

We are still quite a bit slower than MRI on my machine with this test but we 
are five times faster than with force being used.  I will let this bake for a 
while before committing to 1.0 branch (this is in commit 4361 for trunk).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to