Using /locate in a world that does have the thing you're locating (i.e., /locate structure in a world with structures turned off) causes a large amount of lag. Exiting the world causes the game to get stuck on the Saving World screen. I have only tested this on 1.20.1.
Environment
Windows 10, Java 1.20.1, CPU: 16x Intel(R) Core(TM) i7-10700 CPU @ 2.90Ghz
Duplicate of MC-250276.