Been running into a similar problem. Have noticed that since 2.1.1 things are about 30 percent slower than version 2.0
So in order to test this hypothesis I used some benchmarking software someone else had written. I’ve tried to locate it on the board, but nothing showed up. The app was designed to test Codea under pressure, by displaying a frame rate that decreases as the ball count on screen increases. Normally it starts at 60fps, and slowly drops as more and more balls come on the screen.
Under version 2.0 of Codea, on an iPad 4, the app could handle a maximum of 900 balls before it choked. This would require a forced shutdown of Codea, before restarting as it had locked me out, due in part to the single threading.
Under 2.1, the frame rate dropped and would stall at about 450 balls, before choking, but eventually I was allowed to exit the session and restart again. Upon restarting the session, it would invariably have a frame rate of 29 to 30 fps. I put this down to the problems of optimising that were to be fixed in 2.1.1.
However this does not seem to be the case. When running the app, this time using 2.1.1, it does achieve a better score, but only by a margin of 50 percent. Now the session will choke at about 600 balls, whilst allowing me to eventually exit. There is still the problem, that any new session, or a restart of the old benchmarking session, starts with a frame rate of 29 to 30 fps. The only solution to the problem is to force quit Codea. I have included a copy of the benchmark listing below.
Has anyone else seen this problem?
Codea 2.1.1
iPad 4
iOS 8.1.3
------List starts-------
displayMode(FULLSCREEN)
function setup()
physics.continuous=true
tab={} -- table for balls
for x=1,25 do -- start with 5 balls
create()
end
line1 = physics.body(EDGE,vec2(5,5),vec2(5,HEIGHT-5))
line2 = physics.body(EDGE,vec2(WIDTH-5,5),vec2(WIDTH-5,HEIGHT-5))
line3 = physics.body(EDGE,vec2(5,5),vec2(WIDTH-5,5))
line4 = physics.body(EDGE,vec2(5,HEIGHT-5),vec2(WIDTH-5,HEIGHT-5))
end
function create() -- create a new ball in the table
local a=#tab+1
tab[a] = physics.body(CIRCLE,10)
tab[a].x=math.random(30,WIDTH-30)
tab[a].y=math.random(30,HEIGHT-30)
tab[a].friction=0
tab[a].gravityScale=0
tab[a].restitution=1
tab[a].linearVelocity=vec2(math.random(-400,400),math.random(-400,400))
end
function collide(contact)
if contact.state == BEGAN then
-- if the red ball is hit, create another ball and sound
if contact.bodyA.x == tab[1].x and
contact.bodyA.y == tab[1].y then
create()
end
end
end
function draw()
background(50, 50, 50)
fill(255)
text(#tab,WIDTH/2,HEIGHT/2+20)
strokeWidth(0)
for z=1,#tab do
fill(0, 47, 200, 255) -- color of the blue balls
if z == 1 then -- color of the red ball
fill(255,0,0)
end
ellipse(tab[z].x,tab[z].y,20,20)
end
stroke(255)
strokeWidth(5)
line(5,5,5,HEIGHT-5)
line(WIDTH-5,5,WIDTH-5,HEIGHT-5)
line(5,5,WIDTH-5,5)
line(5,HEIGHT-5,WIDTH-5,HEIGHT-5)
fill(255)
text(string.format("%d",1/DeltaTime),50,(1/DeltaTime)*15)
end