I have a list with a milion items (hipotetically) on screen, and each of them has an icon. Not all icons are unique, so I’ve made a sprite atlas with all my icons.
Currently I’m assigning the icon with (UnityEngine.UI.Image) uiItem.Icon.sprite = Atlas.GetSprite(databaseObject.IconName);
The problem with this is, it isn’t using the atlas, instead it’s extracting the image from the atlas, by making a copy/clone and assigning it.
I’ve also confirmed with frame debugger that all icons are being drawin individually, instead of all at once.

How do I do this properly? How can I assign the icon from my atlas to my UI object?
This cloning behavior is well documented:
I think the simple solution is just to call GetSprite once and reuse that Sprite object for all of your Images. Should be very simple to do by storing the sprites with a Dictionary<string, Sprite> for example for reuse by IconName.
Then what is the advantage of using the sprite atlas in my case? Isn’t it better to use direct references to the sprites in my project, instead of creating an atlas and clone sprites from it?
My understanding is that the cloned sprites created by the SpriteAtlas should all be drawn together in a single batch.
Thats exactly what I though. However, when I looked at the batch number, nothing had changed, still had the same amount as my previous implementation before using the Sprite Atlas. And the frame debugger confirmed that.
Did you ever find a non-cloning solution to this problem?