apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49085] New: [PATCH] Speed up file I/O
Date Sun, 11 Apr 2010 19:27:33 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49085

           Summary: [PATCH] Speed up file I/O
           Product: APR
           Version: 1.3.9
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: stefanfuhrmann@alice-dsl.de


Created an attachment (id=25251)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25251)
File I/O speedup patch

The current file I/O comes with large call overhead,
in particular under Windows. For some common usage
that translates into a large relative overhead.

These usages are: reading individual bytes (parser)
or writing small chunks of data (generator outputs).
If we are using non-buffered or multi-threaded files,
some larger sync / OS overhead is required in any 
case. So, we only optimize for the buffered, single-
threaded case.

Another optimization is not buffering large chunks
of data on the write path. That saves extra copies 
and does not pollute the data buffer.

[[[
Minimize relative overhead for buffered I/O of 
small data blocks. Also, eliminate mutex overhead
from single-threaded Win32 code.

* file_io/unix/readwrite.c
  (apr_file_write): add "shortcut" for small buffers;
  don't buffer large chunks at all
  (apr_file_putc, apr_file_getc): add shortcut 
  for the common case

* file_io/win32/readwrite.c
  (apr_file_read): use mutex only if the file is
  possibly accessed from multiple threads
  (apr_file_write_locked): new function, factored
  out from apr_file_flush
  (apr_file_write): defer OVERLAPPED handling;
  use mutex only if the file is possibly accessed 
  from multiple threads; add "shortcut" for small 
  buffers; don't buffer large chunks at all
  (apr_file_putc, apr_file_getc): add shortcut 
  for the common case
  (apr_file_flush): moved most code to 
  apr_file_write_locked

patch by stefanfuhrmann < at > alice-dsl.de
]]]

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message