From: Adrian S. J. <AS...@pa...> - 2002-01-17 10:35:54
|
> From: J.P. King [mailto:jp...@he...] >=20 > Ok, >=20 > I've added a small delay in the loop on cgitelnet, and it now > pauses for 1000th of a second at the end of each loop. I imagine=20 > that it ought to be event driven, but even this small change=20 > has dropped > the CPU usage from 100% down to ~0.06%, and a quick test indicates > that it isn't affecting the performance of the actual interface > in a perceptible way. I presume that this will also reduce the amount of network traffic that it sends. When I tested it from home a few days ago using a dial-up connection, it was using 100% of the available bandwidth. > The code should probably be changed to be event driven rather than > a polling loop, but that is more than I am planning on doing=20 > in the short > term. Similarly I ought to use setitimer and getitimer, but I > am lazy and using usleep. I presume it is doing a non-blocking read then? Should be easy to convert to using select() with a timeout (which will also give you your millisecond 'capable' timer). If you point me at the code, I'll have a look. > I have a few enhancements that should probably be made, like=20 > being able > to select whether to attempt to use the javascript or not. Also, need > to see how to stop it being quite as spaced out as it is at=20 > the moment, > where it adds three lines between lines which are generated=20 > separately. > Also the colours could do with sprucing up. =20 Again, if you want I'll take a look. >=20 > ************************************************************** > *********** > * However, if noone has any objections I'm probably going to=20 > add it to * > * a subdirectory in the Uglymug source tree. =20 > * > ************************************************************** > *********** Go for it, as long as we remember to point out that it has a different licence from the main source. I can't see us writing additional code specifically for web support, especially if we can use someone else's code to do it for us. >=20 > Julian Adrian. |