Lag when moving around with mouse.

Hello! First time posting, never had an issue that I couldn't figure out myself but this one has been bothering me for a while and
I'll take all the help I can get.
I'm trying to figure if this is a fixable problem.

What's the problem ?
When you move using the mouse and you click on a tile that is unreachable by the player the FPS drops instantly.
When moving using the arrow keys this issues doesn't exist.

What I've tried:
Game lags in both test mode and after deployment.
I removed most plugins (didn't work).
I removed all parallel processes.
I reduced the map size.
I made an empty test map with no events and the issue persisted.


What I'll try next:
I'll copy the entire project and change the tiles to the original RPG maker MZ tile set.
I'll remove all plug-ins.
I'll delete half the game in the test copy of the project to see if size is the issue (the game is 2.1GBs before compression).


Any advice is welcome!

By default RMMZ's touch-based movement uses a basic A* pathfinding algorithm with a 12-tile search limit. You might be using a plugin that changes that in some way?
What's the problem ?
When you move using the mouse and you click on a tile that is unreachable by the player the FPS drops instantly.
When moving using the arrow keys this issues doesn't exist.
A* pathfinding is an expensive process in terms of computing resources. The engine is sampling every tile in the vicinity to try to find a path to the destination and the longer it takes to find a path the more resources it takes.

If you want to see what A* pathfinding looks like in action, you can play around with this tool. You can also see what happens if there is no path to the destination by blocking it off.
I suppose "Events and movement core" by VisuStella makes changes to the A* pathfinding.
After I removed the 8-directional movement option in the plug-in options the issue was resolved.
Thank you for the replies, it helped me narrow it down to the pathfinding!

Solved.
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/lag-when-moving-around-with-mouse.158844/