Optimizing a low res pixel game.

I am making a very low resolution, pixel art game. My key goal is to get a perfectly consistent 60 fps. Seeing as how low res the game is, and how it uses little to no effects, I feel this should be doable.

By and large, my game does run at 60fps. However, trouble arises when I put it in f4 fullscreen. After I do that, it often drops to 40fps. Bizarrely, if I maximize the window instead of hitting f4, the fps doesn't drop. I can toggle between maximized and full screen, and the fps will toggle between 60 and 40. Maximized is fine, Full Screen lags.

I've been searching my way through the scripts that come with the game, to find and remove unneeded code, to make the game render easier. As an example, I've commented out Create and Update for Shadows and Weather in Spriteset_Map, because my game won't use them. In PIXI, I've changed all Smoothing to be off, and made it so that scaling is always Nearest. In index.html, I've added CANVAS{image-rendering: pixelated;}, forcing the game to stay pixely no matter the window size.

However... none of this seems to actually do anything to make the game run better. I figured removing smoothing, and making the maps render less would make the game run better, but I'm not sure if it actually helped at all. It didn't hurt, but it didn't help either.

The only thing I've ever done to create 100% consistent performance was by editing PIXI, and making it so that in the WebGLRenderer.prototype.render function, it returns on even frame counts (basically, forcing the game to 30 fps.) This did remove all lag and hiccups... but, locking the game at 30 fps to avoid frame drops feels pretty backwards, you know? To avoid the game going to 40fps, lock it at 30fps? That's a bad solution, haha, and I'm currently not doing that. It's a nuclear option I'd like to avoid.

I am using some plugins. Mostly Yanfly's, but some others. I am also using Irana's Performance Upgrade plugin that just came out. I'm using TileD, and the DSE Audio Lag Fix. Any other plugins I'm using are self contained to specific things, I think these are the only entire game changing plugins. If you want, I can list the entire plugin list. My core files are 1.6.1. I run my game in WebGL mode, not Canvas.

I've checked, and the lag from full screening happens on new games too.

What ways can I optimize my game? What things can I remove? Is there a line hidden in PIXI or the core files that's, like, "Set this to true, and all needless effects will go away, but the game will run 90 times smoother!" Do Yanfly's scripts cause performance issues? Are there other performance enhancers out there? Has anyone else run into this weird full screen lag issue?

Any ideas are welcome!
It might not be a bad idea to monitor your hardware usage to see if that makes any notable difference.
I looked into my computer's performance. I have 4GB of RAM, which is MV's minimum. Thanks to my Microsoft just up and deciding to "upgrade" my computer to Windows 10 without my permission, like half of my RAM is just being used on background junk, so that leaves around 2GB of RAM for MV itself, if I close everything else out. My processor is Intel Core i3 1.50 GHz. So, I don't have some powerhouse machine, that's for sure!

When I run my game at its default resolution, I'm using 25-30% CPU, and 7% GPU. When maximized, same CPU, and GPU shoots up to 70%. Fullscreened, CPU is still the same, and GPU goes up about 5% more. Turning on and off some plugins made the GPU and CPU change maybe a few percent, but its hard to judge at changes that low, maybe the plugins being on and off didn't effect it, and its just the computer's natural variance.

None of these numbers really help me understand why Fullscreen often times drops to 40fps, whereas Maximized stays at 60fps. Seems like it should be both or neither, seeing as how the performance numbers are pretty similar.
Actually, that's not true.
A fullscreen app is always worse than stretched windowed mode app in terms of performance. The reason for that is, among other things, the cpu needs to spend resources to resize the resolution etc. And since Javascript is single-threaded, there's only so much CPU it can use and having to spend resources on resizing etc. decreases the usable portion of the CPU core.

Even on my quad-core 1.6 GHz CPU if I wanted to play an MV game, I always played them on windowed mode and oftentimes I even decreased the window size, because I knew from experience it was much better for me to decrease the size or the window to as small as possible instead of playing it on fullscreen.

Original thread: https://forums.rpgmakerweb.com/threads/optimizing-a-low-res-pixel-game.106832/