I was faced with the following problem: on a computer (number 2) script execution time is significantly greater than on another computer (computer 1).
I use Python to process Excel files. I import for these three libraries:
xlrd
, xlsxwriter
, win32com
Why is the execution time different? How can I fix it?
As explained in a comment, Python uses the Global Interpreter Lock (GIL). As stated on the Wiki: "An interpreter that uses GIL always allows exactly one thread to execute at a time, even if run on a multi-core processor".
Your i3 processor may 'only' have 4 cores instead of the 8 cores in your i7, but Python will only use 1 thread at a time: so the faster the core, the faster your script is executed. As explained on this page: "The CPU speed determines how many calculations it can perform in one second of time. The higher the speed, the more calculations it can perform, thus making the computer faster."