On Sun, 26 Apr 1998, James Turner wrote: >A loop through the character list is a very slow loop as it has almost >no locality of reference. I do believe you're bordering on violating my previously stated rule for CircleMUD: * Speed is not important where it complicates the code unnceessarily. "A loop through the character list is a very slow loop..."? As opposed to what, blinking?! You're taking the speed issue far far beyond what people care. Even I, who thinks he should be able to run Netscape for X Windows remotely over a 28.8 modem line (netscape -display 134.456.789.012:0), doesn't agree with that statement. >Likewise with other loops. Do you know what a tight loop is? Do you >understand what qualifies as one and what doesn't? for (i = 0; i < 10; i++) if (do_something(i)) return i; That is a ripe target for loop unrolling also. >Do you have any concept of how long things take on cpus, even 386s? Even my little 486/50 doesn't care enough to 'optimize' a loop through a linked list. >I suggest you sit down and play with a profiler and maybe spend some time >learning about how modern CPUs operate, and the speed at which they >operate. They operate pretty fast last I checked. >I do advocate breaking away from REMOVE_FROM_LIST; however, that is a >different discussion. With templates or specific functions for every data type? >CREATE(buf, char, 80); > >is more newbie friendly than > >buf = mud_calloc(80, 1); >The CREATE macro does NOTHING for newbies. It is a nonstandard >construction. It will only slow their learning of C. So you don't have to remember to sizeof() or cast things. (To ease C++ transition for those that do.) You have to think along the lines of 'create an object named "foo", with data type "bar", and I need 50 of them.' -- George Greer - Me@Null.net | Genius may have its limitations, but stupidity http://www.van.ml.org/~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/15/00 PST