It's not only performance, but the fact that the front-end and back-end are using the same language. The front end needs JS anyways.
here's the thing: I wouldn't want the front end and the back end of my site to both be written in SQL, either. It's nice to have a single language to develop in, but if that language is not pleasant to work with for some use cases, then it's not as big a win.