ID:1898994
 
Code:
                                  Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
--------------------------------------------- --------- --------- --------- ---------
/obj/Miscell/proc/Construct 27.520 51.559 51.598 10472
/proc/CreateOutline 24.038 24.062 24.161 187374
/proc/char_width 13.446 13.452 13.466 35145
/icon/proc/Blend 10.196 10.198 10.217 19312
/obj/AI_Control/proc/Sweeping 7.097 17.514 17.401 2479
/mob/Move 6.911 13.901


Problem description:
: The above is just a snippet :
Mostly looking for information on what is acceptable and what's not in terms of high cpu , stress usage.
I'm trying to fine-tune / optimize at this point.

Also I have a vague idea on how to read profiles, but any pointers on what I "should" be looking for is appreciated.
Yeah, all of this looks ridiculously high.

Let's start with CreateOutline, because I know for a fact it shouldn't be that high. I assume that's a function for creating outlines around text, right?
In response to Ter13
you would be correct.

proc
CreateOutline(obj/N,obj/X,Nadj as num)
N.color=rgb(0,0,0)
N.pixel_x+=1
N.pixel_y-=1
X.underlays+=N
N.pixel_x=Nadj
//N.pixel_y=0
N.pixel_x-=1
//N.pixel_y+=2
X.underlays+=N
Are you perchance calling CreateOutline multiple times without clearing the old outlines from the underlays/overlays?
CreateOutline (atleast this particular proc) is used for an on screen text chat that the game uses.

It basically writes text as objects, then positions them onto another object as overlay.
It basically writes text as objects, then positions them onto another object as overlay.

Yeah, that's your problem. Appearance churn is going to be a major problem with that.

IMO, it's better to make the entire chat a single object with all messages jammed into its maptext.

Then you only have to create an outline for the single object.

If you add and remove a ton of overlays from stuff, things get crazy slow.


This is currently what I use- far from perfect- the problem I find with maptext is that by default it sort of places all the text in the lower left.

That was the main reason I went with writing onto objects- for positioning. Ultimately though I'm interested in whatever yields the best results, I'm not really interested in sticking with something if it's detrimental to the project.

I had even written a chat made completely of screen objects *but it was a bit wonky with the scrolling* - so I removed it completely.

Yeah, all of your problems come from your onscreen chat.

It's generating a huge amount of appearance churn.

Onscreen chat systems are not something that I can tackle in Developer Help acceptably. It's too convoluted a topic, and one that's too poorly understood.

Moreover, it's not even something I'd be willing to tackle in private for free. It'd cost you two to three weeks of my time, which isn't cheap.
In response to Ter13
That's completely understandable.

I am already re-working how things might be able to work in a more efficient manner.

All in all it took me about 20 hours to write and get what I currently have to work so I completely understand where you are coming from with the time spent.

Just pinpointing the problem does help greatly though. I think I will try a few alternate methods like pre generating the outlined text. I think that would help greatly as well since I wouldn't have to do all of that on the fly.