That's not entirely true. The code must check 9261 blocks for radius 10 but only 343 blocks for radius 3. If the code were to perform the radius 3 test first and found a small or large protector, it would eliminate the need to perform the more costly radius 10 test. If no protector is found in the radius 3 test it would only increase the work by 4%, no where near double. A radius 5 protector would check 1331 blocks and adding a radius 3 check on top of that would be a 26% increase in work, still not double but enough to be noticable. But with radius 10 protectors the radius 3 protector adds almost nothing and has the potential to boost performance.Kilarin wrote:I had suggested different sized protectors once before, and Ten pointed out to me that it would slow down the mod. Currently the protector mod must check to see if a node is within a standard preset distance (10 in this case) of any existing protector. If we add, say, one small protector with a radius of 3, then we now have to have TWO lists of protectors, and do TWO checks to see if the node is within a distance of 3 from a protector on the small list, and if not, THEN we have to check if it is within a distance of 10 from a large protector. thereby doubling the number of checks required for every interaction with a node on the server.
A player digging in the wild would cause both checks to happen. A player building a road with small protectors would only cause the much faster radius 3 checks. A player building inside their radius 10 protected base would cause both checks unless within 3 blocks from the protector. So in most cases both checks would happen. But any action that only triggers the radius 3 check would be 27 times faster!
The new radius 10 checks are 7 times slower than the old radius 5 checks. In the worst case, adding on a second radius 3 check would only make it a measly 7.2 times slower. ;)