Just want to point out -- some recent technologies are aimed at making this a lot better. For example, as WASM is more widely adopted, it will enable developers/companies to code a lot of things in a fast, performant way, bypassing a lot of the abstraction of JS. WebGPU, similarly, is the successor to WebGL and WebGL2 and exposes GPU APIs in a way that is more similar to how the hardware actually runs, rather than in a way that is supposed to be convenient to the developer.
Of course, these are iterative solutions that are going to take a long time for people to adopt. WASM is already fairly far along --
https://caniuse.com/wasm shows that WASM has a 92% support rate globally! And it's gaining traction with developers too -- for example, Microsoft's recent web stuff is apparently all about C# and Blazor.
Anyways, I just think it's encouraging because it shows that even big companies are moving towards a more performant web.