The "slow" compilation speed of TeX has two main reasons:
- It cannot parallelize. Games, GUIs etc. (what you refer to) do use multi-threading to speed up their execution. Because TeX builds up pages gradually (with counters, …) this is not an option and there are some questions about this aspect on the site (see e.g. here), apart from those asking about using the GPU (see e.g. here).
- TeX is a macro expansion language. This kind of "programming" is not necessarily the fastest, but the developers (not engine-wise, but format-wise) try hard not to impose any slow-downs here. That's why some kernel code looks a bit cryptic. And concerning the engines optimization is one of the main concerns.
Just to back up the second point: A primary cause of slow compilation is the general understanding what TeX should do for you. Whenever you load PGF/TikZ or pstricks or something along these lines you essentially use TeX for something it has not been designed for. TeX should do mathematical and text typesetting (and it does that well), it should not produce complex graphics with shadows, draw ducks, plot functions or anything like this. There is a reason TikZ support externalization because this reduces the computations the macro layer has to do on each run.
At some point in history, there were attempts to write a modern TeX engine (NTS, ExTeX, …) – those two in Java – which should be fast and maintainable. But even these "modern" engines are single-threaded and cannot compete with the Web/C driven engines in terms of performance. Even LuaLaTeX as "modern real-world" engine cannot compete with pdflatex on simple documents.
[1] [2] [3] [4]
… looked like a worm slowly making his way across OzTeX’s window on my 68k-powered Macintosh Classic (bought in 1992) at the pace of roughly one page per minute… And there was no TikZ in those years!