will this be a burden to call every 0.5seconds?

local tSort = table.sort
local function sortSpriteGroupA(event)
 local localList = enemyList
 local function comp(a, B)
  return a.y > b.y
 end
 tSort(localList,comp)
 for count =1,#localList do
  spriteGroupA:insert(count,localList)
 end
end 
 

there is a list of displayobjects called enemyList and I want to sort them according to their y coordinates(so the ones on the lower coordinates would come to the front of other objects) in to the

spritegroup (group object)… would this be a process that would influence the performance??

would anyone plz reply,

this is kinda big because if this works fine I’ll finally decide to choose corona SDK as my tool to develop my app and subscribe

or it would be also helpful to suggest any other ways to perform what iam about to do

all I can say is that I used a sorting algorithm for roughly 100 objects, and performed that in every frame. no problem at all.

Couple of thoughts.  First, you need to give the community time to post.  Bumping after 10 minutes is a bit much.

Numerically indexed tables will sort faster than hashed indexed tables.  I’m not for certain, but this feels like it’s using C’s qsort (quick sort) under the hood, which is one of the fastest sort method available). 

The size of the table will determine how fast the sort works. 

:lol:  :lol: sorry I was just worried I might have to rewrite the whole script with some other language and, and just for the record  I did post an almost identical post and no one replied …so

 anyway I was wondering is there a way to sort hashed indexed tables to? you mean I can directly sort a group object rather than sorting a numerically indexed table and then inserting  

would anyone plz reply,

this is kinda big because if this works fine I’ll finally decide to choose corona SDK as my tool to develop my app and subscribe

or it would be also helpful to suggest any other ways to perform what iam about to do

all I can say is that I used a sorting algorithm for roughly 100 objects, and performed that in every frame. no problem at all.

Couple of thoughts.  First, you need to give the community time to post.  Bumping after 10 minutes is a bit much.

Numerically indexed tables will sort faster than hashed indexed tables.  I’m not for certain, but this feels like it’s using C’s qsort (quick sort) under the hood, which is one of the fastest sort method available). 

The size of the table will determine how fast the sort works. 

:lol:  :lol: sorry I was just worried I might have to rewrite the whole script with some other language and, and just for the record  I did post an almost identical post and no one replied …so

 anyway I was wondering is there a way to sort hashed indexed tables to? you mean I can directly sort a group object rather than sorting a numerically indexed table and then inserting