The reason for this startup time was mostly confined to one or two issues that I see all over BYOND games' source code. This is a good time to explain something that you shouldn't be doing.
turf
New()
..()
spawn(TICK_LAG)
//change tile's appearance based on surrounding tiles
^This was basically the problem.
The reason that Yut Put was spawning on New() is because the map doesn't initialize fully all at once. turf/New() is called while the map is still initializing Yut needed information on turfs surrounding the turf to build autotiling information.
I fixed this very simply:
world
New()
..()
MapInitialized()
var
list/__post_init = list()
map_initialized = 0
proc
MapInitialized()
if(!map_initialized)
map_initialized = 1
for(var/atom/o in __post_init)
o.MapInit()
__post_init = null
atom
var
post_init = 0 //set to 1 if you need to do post-initialization stuff.
New()
if(map_initialized)
post_init&&MapInit()
else if(post_init)
__post_init[src] = 1
..() //don't supercall unless you have other /atom/New() functions
proc
MapInit()
//do map initialization stuff here
To the end user, this looks like:
//world startup is 2 seconds
turf
MapInit()
//change tile's appearance based on surrounding tiles
//world startup is 30 seconds
turf
New()
..()
spawn(TICK_LAG)
//change tile's appearance based on surrounding tiles
Also, blatant plug, read my Snippet Sunday #10 for more information on the world startup cycle: http://www.byond.com/forum/?post=2012623
And then I simplified a lot of the type tree structure to reduce the overhead required by the game's initialization.
If you are spawning inside of /turf/New() to make sure the map has a chance to load, you will wig out the scheduler and it will take much longer for your game to start than it should.
The reason that spawn() can create huge problems like this is that spawn() has to copy all of the arguments for the currently running function and insert a new function reference into the scheduler. To ensure the function is called the correct way, the scheduler has to search through all other pending events to find the right place to put the pending function call. If every turf in the world is spawning a function in that scheduler's pending function list, these searches take progressively longer.
spawn() is sometimes used as a "makes game faster" panacea. It's not. If you use it when you shouldn't, it will 100% make your game run like molasses.
Blatant Plug: Read my Snippet Sunday #4 for more information on the scheduler: http://www.byond.com/forum/?post=1638359