ID:2126979
 
https://gyazo.com/4d39da7f87fdd9c23a7389f0255e0395\

What exactly does this proc deal with and how do I reduce its cpu usage.
It's related to displaying icons generated by /icon objects. The icon procs themselves aren't too expensive, but getting them to be displayed is.

You can't really "reduce its CPU usage" aside from not having it called in the first place.

Fortunately, with atom.color, atom.transform, atom.blend_mode, and maybe atom.appearance_flags, you can usually avoid having to use /icon objects at all.

For example, adding color to an icon (such as a piece of black clothing:
// instead of this:
atom.icon += rgb(r, g, b)

// or this:
var icon/i = icon(atom.icon)
i.Blend(rgb(r, g, b), ICON_ADD)
atom.icon = i

// you do this:
atom.color = list(1,0,0, 0,1,0, 0,0,1, r,g,b)

Or multiplying a piece of white clothing by a given color:
// instead of this:
atom.icon *= rgb(r, g, b)

// or this:
var icon/i = icon(atom.icon)
i.Blend(rgb(r, g, b), ICON_MULTIPLY)
atom.icon = i

// you do this:
atom.color = rgb(r, g, b)


How are you using /icon objects? You might not actually need them.
In response to Kaiochao
This is great thanks for the help
Minor correction: atom.color = list(1,0,0, 0,1,0, 0,0,1, r,g,b) won't work as-is; you need to divide the r,g,b values by 255.

Another way to go is atom.color = list(null,null,null,rgb(...)) which uses the short form. In short form, each value is a row and nulls mean "default for this row".
In response to Kaiochao
I removed all instances of Blend, Crop, Shift etc and I'm still getting the same results. Where do you think this proc is being called?
In response to Mav472
If you're using /icon objects and displaying them to clients, e.g. by setting an atom's icon to one, or manually calling fcopy_rsc() (which setting an atom's icon does automatically), then RscFile is called. You don't need to be using any icon procs besides creating one.