> Did you do a corresponding stwrite_* functions? This is a great idea and I > am testing the stread_* functions I wrote now. I Figure the stwrite_* > would also gain a huge performance during operation of the mud.
The reason that reading takes so much cpu is that the fread_* functions pull out and analyze one byte at a time. Since you're normally writing larger chunks at a time with the fwrite_* functions anyway, the gains would be far less pronounced. Plus you would be basically re-inventing the wheel, since all i/o operations are buffered already. I'd just make sure the fp is fully buffered when you are writing files or reading small chunks of data from a file. When you are reading in a bigger chunks like with these stread functions, disable buffering. See setvbuf(3) for more info. --Palrich.

