Hi guys, a script like this:
s,o = commands.getstatusoutput(’:’)
for i in range(300):
The loop goes very slowly, like 10s, after the json is loaded. But without loading the json, the loop just takes 1 second.
Also, this issue only happens when calling os.system/commands.getstatusoutput/os.popen or something like that. If function gen just does some math work，the problem goes away (have same effiency with or without ‘a’).
I run it on a CentOS7 with 32GB RAM and python 3.8, and with the json loaded, the process consumes 1.8GB RAM. No swap is activated.
So I wonder why the loop slows down and how can I make is faster?