Nice points. Linux is very good at buffering data. Writes however do slowdown things. If creating a new thread for every write would save time I would do that. Instead I only create threads for things like resolvers and logsearch functions.
Chris ----- Original Message ----- From: "Mike Barton" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, July 23, 2003 5:35 PM Subject: Re: Simple Performance Speedup. > 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. -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

