http://www.byond.com/members/TheMagicMan/files/opti.png
An initial look will show you one proc is fairly inefficient, but a closer look will actually show you 3 procs are.
UpdateInterface
UpdateShop
and UpdateTeams
All of these procs are fairly inefficient, and using a lot of CPU for the number of times they are called.
A lot more than any other procs in the game.
Here are those free procs...
UpdateInterface(mob/M)
if(!M.client) return 0
M << output("<B>[M]","default.info:1,1")
M << output("","default.info:2,1")
M << output("<B>Level","default.info:3,1")
M << output("[M.Level] ([M.Exp]/[M.ExpNeeded])","default.info:4,1")
M << output("","default.info:1,2")
M << output("","default.info:2,2")
M << output("","default.info:3,2")
M << output("","default.info:4,2")
M << output("<B>Hp","default.info:1,3")
M << output("[M.Hp]/[M.MaxHp]","default.info:2,3")
M << output("<B>Mp","default.info:3,3")
M << output("[max(M.Mp,0)]/[M.MaxMp]","default.info:4,3")
M << output("","default.info:1,4")
M << output("","default.info:2,4")
M << output("","default.info:3,4")
M << output("","default.info:4,4")
M << output("<B>Str","default.info:1,5")
M << output("[M.Str] ([M.StrGrowth])","default.info:2,5")
M << output("<B>Damage","default.info:3,5")
M << output("[M.DamMin]-[M.DamMax]/[round(M.AtkSpeed/10,0.1)]s ([M.dtype])","default.info:4,5")
M << output("<B>Agi","default.info:1,6")
M << output("[M.Agi] ([M.AgiGrowth])","default.info:2,6")
M << output("<B>Defence","default.info:3,6")
M << output("[round(M.Def,0.1)] ([round(-8+(M.Def*5.2)-(M.Def**1.34),1)]% Reduction)","default.info:4,6")
M << output("<B>Int","default.info:1,7")
M << output("[M.Int] ([M.IntGrowth])","default.info:2,7")
M << output("<B>Mag Def","default.info:3,7")
M << output("[round(M.MagDef,0.1)] ([round(-8+(M.MagDef*5.2)-(M.MagDef**1.34),1)]% Reduction)","default.info:4,7")
M << output("<B>Skill Points","default.info:1,8")
M << output("[M.SkillPoints]","default.info:2,8")
M << output("<B>Gold","default.info:3,8")
M << output("[M.Gold]","default.info:4,8")
if(!M.StatusEffects)
winset(M,"default.status","cells=0")
UpdateTeams(mob/M)
var/v=3
if(Game.Match==1)
M << output("<B>Humanity</b>","default.myteam:1,1")
M << output("Kills: [Game.HumanKills]","default.myteam:1,2")
M << output("<B>Legion</b>","default.eneteam:1,1")
M << output("Kills: [Game.LegionKills]","default.eneteam:1,2")
else
M << output("<B>Humanity</b>","default.myteam:1,1")
M << output("","default.myteam:1,2")
M << output("<B>Legion</b>","default.eneteam:1,1")
M << output("","default.eneteam:1,2")
for(var/mob/E in Game.HumanTeam)
M << output("<B>[E]","default.myteam:1,[v]")
M << output("Class: [E.icon_state]","default.myteam:1,[v+1]")
v+=2
winset(M,"default.myteam","cells=1x[v-1]")
v=3
for(var/mob/E in Game.LegionTeam)
M << output("<B>[E]","default.eneteam:1,[v]")
M << output("Class: [E.icon_state]","default.eneteam:1,[v+1]")
v+=2
winset(M,"default.eneteam","cells=1x[v-1]")
proc/UpdateShop(mob/M,mob/E)
var/v=2
M << output("<B>Item","shop.buy:1,1")
M << output("<B>Price","shop.buy:2,1")
M << output("<B>Item","shop.sell:1,1")
M << output("<B>Price","shop.sell:2,1")
for(var/obj/Items/O in E)
M << output(O,"shop.buy:1,[v]")
M << output("[O.Gold]","shop.buy:2,[v]")
v++
winset(M,"shop.buy","cells=2x[v-1]")
v=2
for(var/obj/Items/O in M)
M << output(O,"shop.sell:1,[v]")
M << output("[round(O.Gold/2)]","shop.sell:2,[v]")
v++
winset(M,"shop.sell","cells=2x[v-1]")
If you have not noticed something strange by now you may as well stop reading here.
All of those procs are literally nothing but a series of outputs.
One of them has some minor math involved in it, but they are nothing more than a list of "M << output()".
Does anyone have any idea at all what is making all of these procs horribly inefficient, and how I could fix it?
At the moment I have done everything I can to reduce how often those procs are called.
Other than not use interfaces, there literally does not seem to be a lot I can do. So any suggestions?