Erasing events on map to reduce lag?

I've tried using the scriptcall
Code:
$game_map.events[event_id].erase
with a variable that runs in a loop to erase all 999 events on my test map, but even after they are all gone, the FPS counter is stuck at near-unusable levels. I was hoping erasing the events would actually tell the game to stop calculating them, but it does not do that. Is there a way to actually make it happen?
Could it be, that there are errors that loop, without stoping the game with a "gamebreaking error"?
I am not sure how it works in VXA, but in MV you could open the console with f8 and find out if any error happens..
When i had such lags it wasnt because of events that are calculated if everything works fine.
It was allways because of Functions that were buged or had a wrong Setup. If such errors repait them self without breaking the game that could do heavy lags.
About erasing Events , in MV i could use this-code to erase all events on map:
(you probably used something similar..for vxa)
Code:
//Erase all Events on Map -> Only for MV:
for (var i = 1; i <= $gameMap.events().length; i++) {
     $gameMap.eraseEvent([i])                 
};

->however i suppose if all events are erased and that doesnt help, that there are any other errors that cause the lags.
It might help if you explained why you need to have 999 events on one map and what you're using them for?
I chose the maximum number to make sure it wouldn't be a fluke of my CPU being too powerful and thus falsifying the result once I erased all events.

Original thread: https://forums.rpgmakerweb.com/threads/erasing-events-on-map-to-reduce-lag.126668/