walterhiggins/ScriptCraft — pull request #49 by freerunnering (2013-01-31 00:55:53+00:00)
Title: More efficient box0()

Infinitely faster box0() function.
Box has to create every block inside the space specified, however, box0() only builds walls around things so seems sensible that it should do less work.
However, under the old functions way of doing things it did almost twice as much work.
For small objects this isn't noticed very much, however it can have a big impact on performance!

My use case for this was a 500 wide, 70 high and 500 deep iron wall I wanted to act as the city wall. Trying to make this resulted in 2 odd effects. I first made one wall by calling box(42, 250, 70, 1) and laying it out myself. This took a few seconds. Then I decided to save time I would fly to the edge and create it with box0(). box0(42, 500, 70, 500) completely froze minecraft and slowed my computer. It then preceded to take 20 minutes before I decided to give up and close the server.
After restarting it I had a semi complete giant "solid" block. This made me dig into the Drones code.

Getting to the point: with the old way of doing things a GIANT wall takes over 20 minutes to make. this new version takes under 10 seconds.

(explanation not technically needed just wanted to demonstrate it does make a massive difference)