foxostro / GutsyStorm

Game with voxel graphics similar to Minecraft. (Restart GutsyStorm with Objective-C/Cocoa)
Other
12 stars 4 forks source link

20% of time during initial generation is spent blocked in -neighborhoodAtPoint: #78

Closed foxostro closed 11 years ago

foxostro commented 11 years ago

During initial terrain generation, 20% of the total time is spent in -neighborhoodAtPoint: blocked on locks. To reduce contention, add a new method -tryToGetNeighborhoodAtPoint: that bails out immediately rather than block. (The places that are a problem already bail out to avoid blocking on some other locks, so this won't be a radical change.)

Screen Shot 2012-12-23 at 2 39 31 AM

foxostro commented 11 years ago

This was fixed by the introduction of -tryToGetNeighborhoodAtPoint:neighborhood: which does not block.

e2c8f5e88920490471f0fe1369f1b98d1ed30b91