In the early 00s, CGI scripts lost their popularity due to concerns about performance and security. However, it’s important to note that CGI programs are not inherently slow, but were affected by the limitations of computers at that time. Today, computers are much more powerful, leading to faster and more efficient CGIs. In a recent test, a basic CGI in Python took about 17 milliseconds to run, while a Go version took around four milliseconds. This demonstrates that CGIs are not as terrible as they’re often portrayed. While there are instances where CGI programs may slow down under heavy load, for many web applications, using a CGI program is a perfectly good deployment strategy.
https://utcc.utoronto.ca/~cks/space/blog/web/CGINotSlow