| ▲ | dotdi 4 days ago | ||||||||||||||||||||||||||||||||||
This is not an apples-to-apples comparison. Python needs to load and interpret the whole requests module when you run the above program. The golang linker does dead code elimination, so it probably doesn't run anything and doesn't actually do the import when you launch it. | |||||||||||||||||||||||||||||||||||
| ▲ | maccard 4 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||
Sure it's not an apples to apples comparison - python is interpreted and go is statically compiled. But that doesn't change the fact that in practice running a "simple" python program/script can take longer to startup than go can to run your entire program. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | dekhn 4 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||
It's not interpreting- Python is loading the already byte compiled version. But it's also statting several files (various extensions). I believe in the past people have looked at putting the standard library in a zip file instead of splatted out into a bunch of files in a dirtree. In that case, I think python would just do a few stats, find the zipfile, loaded the whole thing into RAM, and then index into the file. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||