Issue 32526 - some findings about seeks with osl file functions
Summary: some findings about seeks with osl file functions
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: 680m49
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: matthias.huetsch
QA Contact: issues@porting
URL:
Keywords: performance
: 21792 (view as issue list)
Depends on:
Blocks:
 
Reported: 2004-08-03 18:08 UTC by caolanm
Modified: 2010-07-26 19:47 UTC (History)
7 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
strace -c of normal sal (3.37 KB, text/plain)
2004-08-03 18:09 UTC, caolanm
no flags Details
strace -c of modified sal (3.32 KB, text/txt)
2004-08-03 18:09 UTC, caolanm
no flags Details
what happens if sal uses stdio buffering (16.17 KB, patch)
2004-08-03 18:10 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2004-08-03 18:08:32 UTC
Attachings some findings and a plausible patch for comment
Comment 1 caolanm 2004-08-03 18:09:05 UTC
Created attachment 16924 [details]
strace -c of normal sal
Comment 2 caolanm 2004-08-03 18:09:26 UTC
Created attachment 16925 [details]
strace -c of modified sal
Comment 3 caolanm 2004-08-03 18:10:48 UTC
Created attachment 16926 [details]
what happens if sal uses stdio buffering
Comment 4 caolanm 2004-08-03 18:22:09 UTC
The patch (last attachment) modifies osl to use stdio buffering rather than
direct file descriptor read/write which provides an apparent modest improvement
during reading of bootstrap files (see strace of pre and post change which logs
syscalls used from start to frame visible on screen).

Currently the osl readline implementation has no buffering between calls
resulting in a lot of potentially unnecessary seeking.

cmc->sb: Do you think an approach like this provides a benefit ?

mmeeks/dcbw: Might be of interest to you.
Comment 5 mmeeks 2004-08-03 23:27:48 UTC
Caolan - the strace statistics (perhaps) hide the very common pattern [ caused -
I think by daftnesses in various SvStream type APIs ], (wrt. EOS testing) of:

read (3, "fooo", 4);
lseek (beggining);
lseek (end);
lseek (old_location);
read (4, "fooo", 23);

This is really dim, particularly since the kernel will only start doing
readahead when it gets 3 consecutive reads [or similar dumb algorithm] with no
seeks in between - so this blows away any readahead at a potentially large cost.
Comment 6 Stephan Bergmann 2004-08-04 08:36:41 UTC
sb->hro:  Please take care of this.
Comment 7 caolanm 2004-08-04 09:23:23 UTC
meeks: yes. Removing that wild seeking is what I had in mind to improve for the
case of the osl file read at least, and the patch attempt to address that.
Comment 8 hennes.rohling 2004-08-06 10:06:14 UTC
Reassigned.
Comment 9 tino.rachui 2004-08-10 19:28:11 UTC
While I admit that a reduction of system calls like unnecessary lseek's is
desirable I would like to see real profiler data proving that this is a real
bottleneck everthing else is just speculation. Every fix especially in sal is
very sensitive to the whole office any may cause unpredictable side effects. I'd
like to avoid such changes in late phases of the development process if not
solid data advice otherwise. I once fixed the osl_readLine code to read ahead
bytes from a file only to find that the startup performance gain was marginal.
I'm happy to introduce the patch in the beginning of the development of the next
major version. Delayed due to limited resources.
Comment 10 tino.rachui 2005-06-13 12:22:45 UTC
Reassigned for change of responsibilities sake.
Comment 11 stx123 2006-03-20 08:29:55 UTC
You might want to come to a decision how to move forward with the suggested
patch. Changing target to "not determined"...
Comment 12 kai.sommerfeld 2006-11-01 16:27:35 UTC
kso->all: hro is currently sick and will not be available before January 2007.
That's why there is currenly no activity from hro here.
Comment 13 hennes.rohling 2007-04-10 11:09:16 UTC
The patch looks good but we need to do deep testing to make sure there are no
side effects.
Comment 14 hennes.rohling 2007-05-22 12:29:41 UTC
Still planned for 2.3
Comment 15 hennes.rohling 2007-05-22 12:54:25 UTC
*** Issue 21792 has been marked as a duplicate of this issue. ***
Comment 16 hennes.rohling 2007-08-01 10:07:57 UTC
Changed target.
Comment 17 hennes.rohling 2007-11-05 10:16:49 UTC
Added to CWS hro10
Comment 18 kai.sommerfeld 2008-01-14 11:16:49 UTC
cmc: sorry, no time left to integrate into 2.4 codeline.
Comment 19 hennes.rohling 2008-03-28 11:52:21 UTC
Patch will be tested within 3.0 timeline.
Comment 20 hennes.rohling 2008-05-30 10:41:51 UTC
No time to apply for 3.0 as influences on platforms which have problems with
buffered IO have to be tested.
Comment 21 hennes.rohling 2008-08-15 14:54:20 UTC
At least the patch causes an out of file handles problem on Solaris Sparc 32 Bit
(Solaris X86 not tested).
Comment 22 hennes.rohling 2008-09-15 09:52:32 UTC
Ping
Comment 23 hennes.rohling 2009-01-21 10:07:01 UTC
Postponed
Comment 24 matthias.huetsch 2009-03-17 15:40:32 UTC
reassigning to myself ...
Comment 25 tora3 2009-04-21 11:09:37 UTC
mhu: Thank you for inviting me to this issue.

Here is a wiki page describing what cmc mentioned a few years ago. :-)
http://wiki.services.openoffice.org/wiki/Performance/Buffered_File_IO
Comment 26 matthias.huetsch 2009-05-15 11:25:09 UTC
This is now being worked on (cws mhu20) => accepting
Raising priority to P3, adding keyword "performance" ...
Comment 27 matthias.huetsch 2009-08-25 15:04:26 UTC
osl file I/O functions are being implemented as buffered file I/O; work in
progress on cws mhu20 => targeting to integrate into OOo 3.2
Comment 28 matthias.huetsch 2009-08-28 12:43:54 UTC
implementation finished on cws mhu20 => resolved fixed.
Comment 29 joerg.skottke 2009-09-02 13:27:47 UTC
@cmc: Do you want to take a look at the changes to see if the meet your
expectations?
Comment 30 caolanm 2009-09-02 13:46:57 UTC
I'm sure its all good :-)
Comment 31 joerg.skottke 2009-09-08 08:35:37 UTC
Set verified
Comment 32 Martin Hollmichel 2010-07-26 19:47:47 UTC
close issue