Really high CPU and GPU "energy impact" on Xcode

Hello. I am looking at the Native Simple Lua project but adding some simple code that moves something across the screen using eventFrame Runtime listener, and looking at the energy impact and average “component utilisation” in Xcode.

On iPhone SE using IOS 13 it shows maximum energy impact.

How is this so high? Is this something to do with OpenGL ES?

Share some code? Display stuff is resource intensive but we dont know what you actually do there

Yeah sure its just really basic stuff as I said. One item moving on enterFrame. Completely not intensive at all. Im wondering if Xcode isn’t reporting it properly if its an older OpenGl or Xcode is expecting Metal.

SW=display.contentWidth;

SH=display.contentHeight;

local line=display.newRect(0,0,100,50)

line.x=1

line.y=SH/2

line.yScale=0.5

local function move( event )

    line.x=line.x+1

    if line.x>SW then line.x=1 end

end

Runtime:addEventListener( “enterFrame”, move )

Could be that. Display related stuff consumes most power anyway, enterframe calls that every 16ms and apple may try to convice ppl to use metal. It’d be useful to know values that things do and require in general

I did an equivalent simple project in Gideros , also with a Metal enabled version. The Open GL (3) version was running at 17% CPU and the Metal one was running at 11%. So Metal seems to save a lot there. Both 100% all CPU and no GPU.

But back to Corona using Open GL2 - that’s using less CPU at 6% but its sharing it for some reason 50/50 between CPU and GPU. I wonder why the GPU is being worked so much for a scrolling rectangle.

Share some code? Display stuff is resource intensive but we dont know what you actually do there

Yeah sure its just really basic stuff as I said. One item moving on enterFrame. Completely not intensive at all. Im wondering if Xcode isn’t reporting it properly if its an older OpenGl or Xcode is expecting Metal.

SW=display.contentWidth;

SH=display.contentHeight;

local line=display.newRect(0,0,100,50)

line.x=1

line.y=SH/2

line.yScale=0.5

local function move( event )

    line.x=line.x+1

    if line.x>SW then line.x=1 end

end

Runtime:addEventListener( “enterFrame”, move )

Could be that. Display related stuff consumes most power anyway, enterframe calls that every 16ms and apple may try to convice ppl to use metal. It’d be useful to know values that things do and require in general

I did an equivalent simple project in Gideros , also with a Metal enabled version. The Open GL (3) version was running at 17% CPU and the Metal one was running at 11%. So Metal seems to save a lot there. Both 100% all CPU and no GPU.

But back to Corona using Open GL2 - that’s using less CPU at 6% but its sharing it for some reason 50/50 between CPU and GPU. I wonder why the GPU is being worked so much for a scrolling rectangle.