I know this topic has been beat to death but this is another example of why high level language with super optimizing compiler has had less industry success.
If performance is a feature it needs to be written in the code. Otherwise it implicitly regresses when you reorder a symbol and you have no recourse to fix it, other than fiddling to see if it likes another pattern.
To be fair, it’s misleading to group Scala (or any JVM language), with other “high-level languages.”
The JVM is extremely mature and performant, and JVM-based languages often run 5x (or more) than non-JVM high-level languages like Python or Ruby.