Computers are AMAZINGLY fast, EVEN running JavaScript. Most of us have forgotten how fast computers actually are.
The problem is classes calling functions calling functions calling libraries calling libraries.....etc etc
Just look at the depth of a typical stack trace when an error is thrown. It's crazy. This problem is not specific to JavaScript. Just look at your average Spring Boot webapp - hundreds of thousands of lines of code, often to do very simple things.
It's possible to program sanely, and have your program run very fast. Even in JavaScript.