[m-dev.] efficiency situation with file offset tracking

Robert_William HUTTON rwh at ecr.mu.oz.au
Fri Feb 11 14:35:24 AEDT 2000


On Thu, 10 Feb 2000, Fergus Henderson wrote:
> On 10-Feb-2000, Robert_William HUTTON <rwh at ecr.mu.oz.au> wrote:
> > Well, after much stuffing around and many recompilations due to
> > home/mercury0 being full, I have managed to profile cat.m with and without
> > file offset tracking in io.m.  The top parts of the profiles follow.
> 
> So that's what, 8% slow-down?, for a program spending almost all it's time
> doing I/O.  That's probably acceptable.
> 
> It might be good to also check the overhead for a version of cat that
> does I/O character at a time (via io__read_char) rather than line at
> a time (via io__read_line_as_string).  If that is not significantly
> worse, then I'd say go ahead and commit this change.

For a version of cat that uses io__read_char and io__write_char:

Without changes to io.m:
   %  cumulative    self              self    total
 time    seconds  seconds    calls  ms/call  ms/call name
 62.1       2.55     2.55  8846154     0.00     0.00 <predicate
io:'read_char'/3 mode 0> [4] 
 21.9       3.45     0.90  8846153     0.00     0.00 <predicate
io:'write_char'/3 mode 0> [5] 
 15.8       4.10     0.65        1   650.00  4100.00 <predicate
cat:'cat'/2 mode 0> [3] 

With changes to io.m:
 67.3       3.10     3.10  8846154     0.00     0.00 <predicate
io:'read_char'/3
 mode 0> [4] 
 20.6       4.05     0.95  8846153     0.00     0.00 <predicate
io:'write_char'/
3 mode 0> [5] 
 11.9       4.60     0.55        1   550.00  4600.00 <predicate
cat:'cat'/2 mode
 0> [3] 

This seems to be pretty consistent with the previous profiling I did with
the version of cat that uses io__read_line_as_string.

I'll commit this change soon, unless anyone wants me to do some _more_
efficiency testing ;-)

-- 
Robert Hutton <rwh at ecr.mu.oz.au>     | War doesn't demonstrate who's
WWW: <http://www.ecr.mu.oz.au/~rwh>  | right... just who's left.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list