[Solved] Need some help debugging a performance issue with autorun common event

Greetings,

So I'm trying to make a custom status menu. It's nothing fancy, it just uses images to display various things based on variables. Since my game has no combat, stats, classes, weapons, parties, enemies, items or anything really resembling an RPG, I've disabled the main menu because it would literally serve no purpose. I've managed to co-opt the menu button to open my status display. I have it set up so that if you press the menu button again while it's up, you'll be asked if you want to quit (to retain the exit functionality of the original menu) or if you press cancel, it closes the status screen and goes back to the game. This is all handled with a parallel event.

◆If:Script:Input.isTriggered('menu') && Check.is_any(13,0)
◆Control Variables:#0013 ACTIVE MENU = 1
◆Common Event:INSPIRATION MENU
◆Exit Event Processing
◆
:End
◆If:Script:Input.isTriggered('menu') && Check.is_any(13,1)
◆Erase Picture:#1
◆Control Variables:#0013 ACTIVE MENU = 0
◆Text:None, Window, Bottom
:Text:Are you sure you want to exit the game? All progress
:Text:since the last time you slept will be lost.
◆Show Choices:Yes, No (Window, Right, #2, #2)
:When Yes
◆Script:SceneManager.exit();
◆
:When No
◆Control Variables:#0013 ACTIVE MENU = 1
◆Common Event:INSPIRATION MENU
◆
:End
◆
:End
◆If:Script:Input.isTriggered('cancel') && Check.is_any(13,1)
◆Erase Picture:#1
◆Control Variables:#0013 ACTIVE MENU = 0
◆Control Switches:#0012 TRANSFERALLOWED = ON
◆Exit Event Processing
◆
:End

This is all fine and dandy. The only problem is that while the status menu is open, the player can move around and even click on other events or even leave the map and go to a new one. I've done searching and I know what you're going to say, "Use an autorun event because the player can't move during an autorun event."

However, I've tried this and while the autorun common event is active, there is a MASSIVE performance hit. The framerate drops from 60fps to sub-30fps while the image is being displayed. This is the code I came up with:

◆If:Script:Input.isTriggered('menu') && Check.false(38)
◆Control Switches:#0038 MENUOPEN = ON
◆
:Else
◆If:Script:Input.isTriggered('menu') && Check.true(38)
◆Erase Picture:#1
◆Control Switches:#0038 MENUOPEN = OFF
◆Text:None, Window, Bottom
:Text:Are you sure you want to exit the game? All progress
:Text:since the last time you slept will be lost.
◆Show Choices:Yes, No (Window, Right, #2, #2)
:When Yes
◆Script:SceneManager.exit();
◆
:When No
◆Control Switches:#0038 MENUOPEN = ON
◆
:End
◆
:End
◆If:Script:Input.isTriggered('cancel') && Check.true(38)
◆Erase Picture:#1
◆Control Switches:#0038 MENUOPEN = OFF
◆
:End
◆
:End

I cannot for the life of me figure out why the performance tanks while this is running. The common event is currently setup to just display the menu background while I try and figure this out, so it's only a single 720x720 image. The event is set to trigger when that switch is on. There is literally nothing else in the event.
I cannot for the life of me figure out why the performance tanks while this is running

because the engine is updating all the events on the map, plus the triggers for the events, plus the active event, which consists on showing a picture, which triggers the update for the collection of pictures.

if you did this by code, with a proper interface rewrite, you can disable unnecessary updates once the menu has been drawn.
Edit: I solved this. What I did was add a second page to the parallel event calling the menu. Opening the display switches to the second page, which stops the parallel version of the event running and switches to an autorun version, which displays the graphics and handles the input processing. Closing the display switches back to the parallel event.

Long story short, RPG Maker MV does not like it when you run a parallel event and autorun event at the same time? I really hope the next version of RPG Maker makes serious strides in the way of performance because this is three consecutive versions now (XP, VX/Ace and MV) that have all had major performance issues.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-need-some-help-debugging-a-performance-issue-with-autorun-common-event.117157/