Yandere Simulator is made with the Unity game engine. Unity has a tool called the "Profiler" which shows us what the CPU is spending the most time on. Using the Profiler, we can see what the CPU spends its time doing when running Yandere Simulator.
The Profiler shows us that the CPU spends 48% of its time on rendering, and only 12% of its time executing the "Update()" function of scripts: https://i.imgur.com/eJEs5m5.pngThis discredits the idea that "bad code" is the culprit of any framerate issues found in Yandere Simulator. Improving Yandere Simulator's framerate will involve making optimizations to rendering, not code.
The most "heavy" script in the game, StudentScript, only takes up 2% of the CPU's time, and that's only because there are 88 of them running simultaneously: https://i.imgur.com/gGjtav0.pngThat's right - the one script that uses the most else-if statements needs to run 88 times to make even 2% of a difference.
It may be worth mentioning that "Yandere Simulator has a bad framerate!" became a meme many years ago, when Yandere Simulator actually did suffer from performance issues. However, the game has been through many optimizations and framerate improvements since then, making the meme less and less accurate with the passage of time. In 2016, it would have been true to say that even a powerful computer could not run Yandere Simulator at an acceptable framerate. However, that same computer should have no problem running a 2023 build of Yandere Sim. (You can download a build from 2016 and a build from 2023 and test them yourself if you don't believe me.)
The bottom line is that most the people who have attempted to critique my code have made a very large number of completely incorrect and invalid statements to their audiences, leading countless people to develop an inaccurate perception of Yandere Simulator's code and my own programming ability.