ID:1670738
 
Keywords: byond, cpu, daemon, profiler
(See the best response by GhostAnime.)
So I downgraded to v506.1247 to test out daemon because my cpu was going crazy but did not show up on the profiler (Similar to Eternias Problem). Task manager would show the game running at 1-5 then jump up to around 37-40 randomly after about an hour. With this version you could run the profiler before the world is loaded. I did this and found procs taking up a large amount of cpu before the world even started? Not sure how this is even possible.. maybe infinite loops associated with turfs. Maybe this version of byond is just bugged? On the updated version of byond my self cpus werent this high and broken. By the time the world is done loading the self cpu is at like 800, but it just stays there. I can fix most of those high cpus by just disabling them but how do i disable a proc if I don't know its name. Why are some of them blank. Whats going on seriously lol?

http://oi57.tinypic.com/2r450es.jpg
I can't speak for the blank names (shouldn't happen IMO, so is probably a bug) but according to the profiler you're running code on /turf/Terrain/Sand/New() and /turf/warp/EpicWarp/New() that's delaying start-up.

Post snippets of that code, maybe we can point out the cause so you'll know what to avoid.
In response to Sir Lazarus
I don't care about that code really. I actually just removed everything from those codes. I just need to figure out why those procs are coming up as blank.
Best response
Based on Ter13's post, those blank entries may be from code blocks resulting from spawn()s.

Alternative solution: Try doing set waitfor = 0 in those procs and sleep().

Ex:
http://www.byond.com/forum/?post=272154#comment1177039
In response to GhostAnime
"Try doing set waitfor = 0 in those procs and sleep()." Which procs exactly? I mean wouldn't i have to do set waitfor = 0 in every single proc. Also what exactly would this result in? I'm not 100% sure what you're asking me to do sorry. Also, later versions of byond should allow the user to run the profiler before startup to catch these sort of things.
In response to Sir Lazarus
New()
..()
var/match = 0
for(var/turf/warp/EpicWarp/P in world)
if(P.WINDEX==src.WINDEX && P!=src)
Wx=P.x
Wy=P.y
Wz=P.z
match = 1
break
if(!match)
world.log << "EpicWarp failed: ([x], [y], [z]): No match for WINDEX=[WINDEX]"
Whereever you have spawn(), replace it with sleep() and put "set waitfor = 0" at the top of that proc.

Ex:
// Old
proc/Dem_Clones()
var/Clone/X = new(src.loc)
spawn(10)
del(X)

// New
proc/Dem_Clones()
set waitfor = 0
var/Clone/X = new(src.loc)
sleep(10)
del(X)


Spawn() would ause a blank entry. With sleep(), it keeps the pro name + waitfor = 0 treats it similar to a spawn in the aspect that the parent proc does not wait for a value from the pro. called
Great Awesome thanks a ton. I'll do that right now and post the results.
In response to GhostAnime
I removed spawn() from most procs.. and replaced them with sleep()
The name is still blank.. so probably just a byond bug? I mean it would have to be something that runs at start up because as soon as I start loading the world the self cpu starts going crazy. Once the world loads it stops going up but it's already at like 700 cpu.
I have encounter this few times with, few Byond Updates so yeah it can be bug, Going back to a preview build can fix this problem
In response to Zasif
if by "going by to a preview build" you mean downgrading? then yea that's what this whole thing is about. I downgraded to an older version because the newer version wont let you run the profiler until the world has completely loaded. I also get -cpu not sure what that means.
In response to Zasif
It's definitely associated with the creation of an object or a turf. I disabled each map and the cpu problem only came with the world map.. the one with all the turfs. Although its still a blank name on the profiler this kinda narrows it down. How does a game start off at 200 total cpu but -7 million self cpu???? Please fix these bugs.