According to these four profiles, caches are good and checks in loops are minor speed reduction. (As I knew, but I prefer safety over speed.) With cache and loop check: 3.75 0.59 0.03 90252 0.33 0.85 detach_buffer 2.50 0.61 0.02 131526 0.15 0.15 get_buffer_head ( self secs ttl sec calls self/call ttl/call ) Without cache and with loop check: 9.68 0.64 0.09 90252 1.00 2.33 detach_buffer 6.45 0.70 0.06 180530 0.33 0.33 get_buffer_head ( self secs ttl sec calls self/call ttl/call ) Note 27% reduction in get_buffer_head() calls and detach_buffer is 274% as fast using the cache. (Based on total per call.) Taking out the (if ptr == ptr->next) checks gave an average speed improvement of .2 us/ms* per call. All tests were with an exit() statement immediately after the line log("No connections, going to sleep."); * self us/call implies usecs but the comments at the bottom state it is in milliseconds. I tend to believe the milliseconds. Profiling is cool. For GCC, set PROFILE = -pg in the makefile and run 'gprof ../bin/circle gmon.out' in the lib directory after running the mud and exiting. If you don't have GNU prof, normal prof works with a -p I believe. -- greerga@muohio.edu me@null.net | Genius may have its limitations, but stupidity http://www.muohio.edu/~greerga | is not thus handicapped. -- Elbert Hubbard +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST