[cvs-nhc98] patch applied (hat): Hat library: Implemented new buffering scheme.

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:18:14 EDT 2006


Wed Jun  5 08:04:13 PDT 2002  olaf
  * Hat library: Implemented new buffering scheme.
  
  At Cambridge we noted, using strace, that fseek disturbs the file buffering of the operating system. It seems fseek always requires synchronisation. Hence it is important for efficiency to reduce the number of fseeks.
  
  New trace nodes are not written directly to file but buffered. The advantage is that most updates concern parts in this buffer and hence can be done there instead of requiring an expensive fseek. The updates outside this buffer are still buffered separatly, so that basically only one fseek is required per update, not another one for going back to the end of file. Naturally the stack is also still used.
  
  The sequential write buffer consists of 4 buffers a 20000 bytes. The exact number and size do not influence the performance on my machine very much. About 0.5% of the updates are outside the buffer. Runtime is reduced by about 45%.

    M ./src/hatlib/Makefile -2 +2
    M ./src/hatlib/hat-c.c -906 +755


More information about the Cvs-nhc98 mailing list