4 ms·
Something about CGI and perl always rubbed me the wrong way. On every request, you're spawning a new process from disk, reading the entire script's source code
by ninkendo 5y ago
Something about CGI and perl always rubbed me the wrong way.
On every request, you're spawning a new process from disk, reading the entire script's source code (including everything it imports), compiling it, and running it, just to throw all that away.
I do appreciate how simple it is, and how much it inherently frees its own resources, but it seems super wasteful. I'm actually quite shocked how common it was in the early days of the internet.
- psd1 5y agoWhat if I told you that my team does that today, for a million hits a month, and the process it spawns is powershell.
- Macha 5y agoI suspect the site in question has rather less than a million hits per month, and the development staff is more a week of contractor time every couple of years than a full time team. This would make it hard to have a continuity of legacy technology devs and make it more likely that it just gets archived by a future team as that's easier than finding the appropriate expertise.
- bityard 5y agoSpawning processes on unix is very cheap, Perl was very fast, and even back then disk cache in RAM was a thing. It's a perfectly fine solution if your site doesn't need to scale, and most do not.
- ninkendo 5y agoI'm definitely aware, having done a lot of CGI programming in perl myself back then. But nowadays it just seems so strange to boot up an interpreter and start parsing/validating/executing a script from scratch on every request. Even if you have disk cache and fast process launching, it's just a lot of work you have to do each time.