Rope performance on corona

Hello everyone, i am thinking on implement code to create a rope, grabbing a ball, we have some examples of code and examples of games like cut the rope, but i have some troubles and doubts about a rope performance made with corona, because i can see on example edited by me that the performance isnt the better, maybe because i work little with this
Anyone can talk a little about this subject, give your opinions etc

[code]
display.setStatusBar (display.HiddenStatusBar)

–> Start Physics
local physics = require (“physics”)
physics.start ()
physics.setGravity (0, 9.8)

–physics.setDrawMode (“hybrid”)

–> Create Walls
local leftWall = display.newRect (0, 0, 1, display.contentHeight)
local rightWall = display.newRect (display.contentWidth, 0, 1, display.contentHeight)
local ceiling = display.newRect (0, 0, display.contentWidth, 1)
local floor = display.newRect (0, display.contentHeight, display.contentWidth, 1)

physics.addBody (leftWall, “static”, {bounce = 0.0, friction = 10})
physics.addBody (rightWall, “static”, {bounce = 0.0, friction = 10})
physics.addBody (ceiling, “static”, {bounce = 0.0, friction = 10})
physics.addBody (floor, “static”, {bounce = 0.0, friction = 10})

local xCenter = 160
local wCeil = 120
local hCeil = -5
local xCenter1 = 160
local wCeil1 = 120
local hCeil1 = -5

local prevBody = ceiling
local prevBody1 = ceiling

local w,h = 10,10
local halfW,halfH = 0.5*w,0.5*h
local w1,h1 = 10,10
local halfW1,halfH1 = 0.5*w1,0.5*h1

– center of body
local x = xCenter
local y = hCeil - halfH
local yJoint = y - halfH
local x1 = xCenter1
local y1 = hCeil1 - halfH1
local yJoint1 = y1 - halfH1

– rope
for i = 1, 30 do
y = y + h
yJoint = yJoint + h
y1 = y1 + h1
yJoint1 = yJoint1 + h1

local body = display.newImage(“rope.png” ,x-halfW, y-halfH)
local body1 = display.newImage(“rope.png” ,x-halfW1, y-halfH1)

physics.addBody( body, { density=40, friction=0.5, bounce = .2 })
physics.addBody( body1, { density=40, friction=0.5, bounce = .2 })

local joint = physics.newJoint( “pivot”, prevBody, body, xCenter, yJoint )
local joint2 = physics.newJoint( “pivot”, prevBody1, body1, xCenter1, yJoint1 )

prevBody = body
prevBody1 = body1
end

– final body

local body = display.newImage(“soccerball.png”, x,y -30);
local r = body.height *0.5

physics.addBody( body, { density=5, friction=0, bounce=0, radius=r })

body:applyLinearImpulse(100, 0, body.x, body.y)

local joint = physics.newJoint( “pivot”, prevBody, body, xCenter, y )
local joint2 = physics.newJoint( “pivot”, prevBody1, body, xCenter1, y1 )
[/code] [import]uid: 26056 topic_id: 15500 reply_id: 315500[/import]

I tested.
obviously I don’t have your images so I used display.newCircle (which would use less memory)

using this memory function:
[lua] local lastCheck = {sysMem = 0, textMem = 0}
Runtime:addEventListener(‘enterFrame’, function()

– watch for leaks

collectgarbage()

local sysMem = collectgarbage(“count”) * .001
local textMem = system.getInfo( “textureMemoryUsed” )*.000001

if lastCheck.sysMem ~= sysMem or lastCheck.textMem ~= textMem then
lastCheck.sysMem = sysMem
lastCheck.textMem = textMem

print ("Mem: " … math.floor(sysMem*1000)*.001 … "MB \t TextMem: " … math.floor(textMem*1000)*.001 … “MB”)
end
end)[/lua]

I got:
Mem: 0.093MB TextMem: 0.262MB
Mem: 0.091MB TextMem: 0.262MB
Mem: 0.092MB TextMem: 0.262MB

that rope is pretty cool. [import]uid: 79135 topic_id: 15500 reply_id: 57365[/import]

Thank you anddrewscott for the test, now i will work on the rope to improve the algorithm
but i continue with some of doubts about how a rope made with corona can behave on device, because on my opinion the game cut the rope is so fluid, the rope is perfect, and i dont know if this performance is possible with corona. [import]uid: 26056 topic_id: 15500 reply_id: 57418[/import]