Parallax maps vs lag/game crash

Here another example where the Player transforms into a Dragon aslong he is holding the OK Button.
Wrong:
Code:
◆If:Button [OK] is pressed down
  ◆Change Actor Images:Harold, Actor1(0), Nature(6), Actor1_1
  ◆
:Else
  ◆Change Actor Images:Harold, Actor1(0), Actor1(0), Actor1_1
  ◆
:End

Better:
Code:
◆If:Button [OK] is pressed down
  ◆If:Self Switch A is OFF
    ◆Control Self Switch:A = ON
    ◆Change Actor Images:Harold, Actor1(0), Nature(6), Actor1_1
    ◆
  :End
  ◆
:Else
  ◆If:Self Switch A is ON
    ◆Control Self Switch:A = OFF
    ◆Change Actor Images:Harold, Actor1(0), Actor1(0), Actor1_1
    ◆
  :End
  ◆
:End
Conditions drain no performance in comparison to the execution of the Change Actor Graphic Command.
hmmm This gave me a good idea.
Thank you for sharing your event, sir.
Okay, I still couldn't find a problem of lagging (I don't know how-sorry-), but, I've managed to reduce the lagging by setting a wait command for 10 frames when loading the parallax tilemap.
OMG! All the stress I've put myself through when I could just solve the problem by using erase event command! 😩
Thank you very much! And I'm terribly sorry for all the unnecessary troubles!
You have been told that the cause of lag can be various, pc spec, inefficient plugins, more events, or just inefficient events because of the user's error. Next time, please do not avoid the question by saying you're looking for a general cause of lag in parallax mapping. Your problem can be more specific than that.
Yes. I'm sorry about that, sir.

Closing at OP's request.

Original thread: https://forums.rpgmakerweb.com/threads/parallax-maps-vs-lag-game-crash.110299/