[cvs-nhc98] Improved speed of writing new trace.

User olaf olaf@sparud.net
Thu, 18 Apr 2002 18:54:40 +0200 (CEST)


olaf: Thu Apr 18 18:54:39 CEST 2002

Update of /usr/src/master/nhc/src/hat/lib
In directory hinken:/tmp/cvs-serv26405/src/hat/lib

Modified Files:
	hat.c hat.h 
Log Message:
Improved speed of writing new trace.

Introduced buffer to defer updating (entering and result) and then do the updates in bulks. Improves Adjoxo from 30s to 24s. Independent of buffers size between 16 bytes and 128 Kbytes. Only worse for smaller buffers. Main effect is probably halfing of number of seek operations.

Then added some update avoidance: Updating of result first tests (linear seach) if such an update is already in the buffer and then overwrites it in buffer. Improves Adjoxo further to 20s for small buffers (32-64 bytes). Larger buffers increase linear search unduly, although system time is still reduced further.

Finally, make linear search through buffer backwards, because overwritten entry is most likely the most recently entered one. Improves Adjoxo further to 17.5s for buffers between 1KB and 4KB. Clearly similar to previous times for small buffers. Slight increase for larger buffers.