4 ms·
Python's site module contributes a lot to this. It attempts to load a lot of other modules, many of which may not exist for a given install. Using your example
by jamesdutc 10y ago
Python's site module contributes a lot to this. It attempts to load a lot of other modules, many of which may not exist for a given install.
Using your example:
$ strace python3 -c 'print("hello world", end="")' 2>&1 | hist
1. stat 122
2. rt_sigaction 68
3. fstat 67
4. read 55
5. close 47
6. open 37
7. mmap 34
8. lseek 30
9. getdents 18
10. mprotect 16
...
TOTAL: 567
$ strace python3 -S -c 'print("hello world", end="")' 2>&1 | hist
1. rt_sigaction 68
2. stat 51
3. fstat 39
4. mmap 31
5. read 27
6. close 26
7. open 23
8. mprotect 16
9. lseek 15
10. brk 10
...
TOTAL: 350