Python Forum
Slower script on faster machine?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slower script on faster machine?
#1
Hi, I am currently running a script created for me by my developer. I do not know much about the details about the script other than that we use it on ARCGis with arcply. I am not an experienced programmer so I cannot comment on the script specifics the issue however seems to be related to the machine or its configuration. The issue I am encountering is when I run the script on a slower laptop the script runs as expected with 27% CPU utilization. When I try to run the script on a desktop with hardware far superior to the laptop it runs with CPU utilization of 7% and much slower than what the laptop runs. They are both 32 bit installations and have tried many variations in regard to the location of the data and the script. Any help would be appreciated as I am not very knowledgeable python user. thanks.
Reply
#2
If in neither case 100% CPU is being used, then the CPU is not the "bottleneck" and the script is not "CPU-bound" so it must be something else.

That something else could be lots of things (most referred to as "IO-bound") like hard-disk, RAM or network usage. Those differences can be operating system-dependent, further complicating things. It can also be because other processes on the same machine; maybe the laptop didn't have other programs, but that beefy machine is being used more since it's beefy.

Is there any reason you can't talk to your developer?
Reply
#3
I do have communications with the developer however he seems to be unable to figure out the issue or is to busy to bother helping out. The more powerful desktop has low utilization right now because we built it for another program that was an experiment that is currently on hiatus. The only thing running is the script and there is nothing else with network utilization on the machine. Meanwhile the laptop I am running the script faster on is running Word, chrome, outlook and more at the same time. I am unsure if there were any extensions added on the laptop that would have improved speed and the user on the laptop does not have the technical skill to manually adjust for performance. Both machines seem to have the default installations on them however as I mentioned before I am no python expert. What operating system problems should I be aware of? I believe both are win7 64bit.
Reply
#4
The type of and amount of RAM could make a difference, as well as type and speed of hard-disk (RPMs) or solid state.
Reply
#5
Have you run "Task Manager" on both machines? Specifically the "Processes", "Details" and "Performance" tabs? Both with your script running and not running (under "Processes" and "Details" it will probably show up as "Python") .  The "Services" tab will show all services that are available and their status (i.e. Running, Stopped, Disabled). The "Startup" tab will show you all the programs that start when you turn on the computer and are running in the background.  From the last two, you can see there is a lot going on in the background. As micseydel pointed out, the hard drive and or ram could also be a problem. A badly fragmented drive or bad sectors will impede performance.  A bad ram set will also degrade service.   It is near impossible to diagnose without having either the script and computers available, but a little "detective" work on your part will at least get you started.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#6
I do not believe that it is a hardware issue, the desktop has superior hardware in all cases when compared to the laptop. I absolutely think that it is a configuration or extension that the laptop has.
Reply
#7
(Jan-04-2017, 09:31 PM)guest123 Wrote: I absolutely think that it is a configuration or extension that the laptop has.
Why are you so sure? Have you looked at the type of the RAM and persistent storage (not just the size)? Have you defragmented the beefier machine like sparkz_alot suggested?

What is the wall-clock time of the script on each machine? Have you verified that the input and output are identical?

Are you able to provide the script?

I don't say this to be a jerk, but on forums like this people are frequently confident that things are the same and then after a ton of investigation it turns out it was something simple (like the beefier machine was a large hard drive, but it's a hard disk instead of solid state, for example).
Reply
#8
If it's a far superior machine, why is it still 32bit? Why is either machine 32bit?
That shouldn't matter for this, but still :/

What does the script do? Read files? Build databases in memory? Communicate with satellites and arrange for shaved ice to be delivered to the office? Filter emails on an external server according to pre-defined rules? Control a robot via bluetooth?

You could try running the script in a virtual machine on each physical machine, so the specs are 100% identical, and see if it's still different (...somehow, lol).
Reply
#9
Windows? Well, consider to look at the virtual memory. Windows writes the data on the hard drive wherever it find a place. Fragmentation was mentioned yet but ... Windows is willing to use the virtual memory a lot by default. If this memory is set with dynamic size ( by demand and if I remember this is by default ) what is happens is constantly fragmentation of the page file. Set manually the size of the virtual memory, run the windows defragmentation program ( twice. I've seen that one run doesn't do it )
In order to has a good performance a Windows box have to has both fast CPU hard drive. My experience. 

Apologize my English  Cool
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Program running a lot slower after change to Ubuntu hubenhau 1 2,841 Mar-02-2021, 05:01 PM
Last Post: Serafim
  help need with running python script on remote windows machine onenessboy 2 11,017 Dec-14-2018, 03:02 PM
Last Post: onenessboy
  The number of object makes code slower? fig0 1 2,466 Jan-25-2018, 11:16 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020