Should I shrink an array and will it improve performance in the long run?

UPDATE: I used the struct solution and it's incredible. cleaned up my code so much and had a lot more benefits than initially anticipated. I recommend peeking structs and nesting them as well if you are in a similar position.

~~ OP Below ~~

I am not very knowledgeable with how performance and memory related things work but I am making an animation state engine at the moment and am currently filtering down my object ids to enums to keep an array small, but can skip the middleman by just using object indexes and pushing on the array, but with object ids being so wild in size, im sure itd make the array massive, and if it did if that makes a big impact?

//CURRENT VERSION

//scr_anim_init();
//global.primary_anim[obj][state] = spr_state
for (var i = 0; i < enemy.ending; i++)         //Set everything to ERROR
{
   for (var j = 0; j < e_state.ending; j++)
  {
      global.primary_anim[i][j] = spr_enemy_error;
  }
}

global.primary_anim[enemy.goblin][e_state.idle] = spr_goblin_idle;
global.primary_anim[enemy.goblin][e_state.walk] = spr_goblin_walk;
//... etc. I do this for every enemy, every state

//-----------------------------------------------------------------------

///scr_who_am_i();   <----- this is what im wondering if I can remove
//find out who I am in relation to my enum #
if object_index == obj_goblin {who = enemy.goblin} 
if object_index == obj_spider {who = enemy.spider} 
//... etc. I do this for every enemy 

//-----------------------------------------------------------------------

///Draw Event

draw_sprite_ext(global.primary_anim[who][my_state],_frame,_x,_y,_xsc,_ysc,_rot,_col,_alp);

//IDEA VERSION

///scr_anim_init();
//global.primary_anim[object][state] = sprite_state
global.primary_anim = array_create();
var _array = global.primary_anim;

var _obj = obj_goblin;
array_insert(_array, _obj , 1); 
array_insert(_array[e_state.ending], 1);
global.primary_anim[obj_goblin][e_state.idle] = spr_goblin_idle;
global.primary_anim[obj_goblin][e_state.walk] = spr_goblin_walk;
//... etc. each enemy would insert _obj on the array

//-----------------------------------------------------------------------

///Draw Event

draw_sprite_ext(global.primary_anim[object_index][my_state],_frame,_x,_y,_xsc,_ysc,_rot,_col,_alp);

If there is another way that can take out some obfuscation that I don't know that'd be cool to. Basically just trying to remove some sections of where I have to add every single enemy.
I currently have to:

  • add an enum for it
  • add it to the enum conversion
  • add it and each animation frame to the animation list

Looking to simplify this flow as I use it for basically any entity in the game, this is JUST the enemies one.