You can answer all these questions yourself
1. Test with code
Code:
var timeStart = get_timer();
//complex or looped operation
var timeEnd = get_timer();
var time= timeEnd - timeStart;
show_message(time)
Run this for an array operation and then a mirror ds_grid operation and compare
You'll see that ds_grids are usually much faster
2. Read the documentation.
https://docs.yoyogames.com/source/d...uage overview/variables/global variables.html
Just like local variables, global variables must be declared
Code:
myLocalArray = []
myLocalGrid = ds_grid_create(0,0)
global.myGlobalArray = []
global.myGlobalGrid = ds_grid_create(0,0)
4.
https://docs.yoyogames.com/source/d...instances/instance properties/persistent.html
Persistence is an instance variable
3 and 5.Create a simple game
objGame creates and destroys objArray and objGrid with key board keys
objArray has a very large array
objGrid has a very large ds_grid
Run the debugger and:
for 3
create a few of one type of object
observe the memory increasing in the profiler
then destroy them all
observe whether the memory goes back down
repeat for the other type
You'll see that GM doesn't garbage collect for either of them
for 5
in a fresh room observe how much memory n objects of one type take
refresh the room and repeat for the other type with the same n of objects
You'll see there's basically no difference