| View previous topic :: View next topic |
| Author |
Message |
maximina
Joined: 17 Oct 2007 Posts: 16
|
Posted: Wed Oct 31, 2007 3:17 am Post subject: Using more than 50% of the CPU |
|
|
I have a script that creates a database on the fly. It's a rather large database and can take 10-13 minutes to complete this process. But I strongly believe it should be getting this done much faster. I spent an entire day reworking the code to only shave seconds from this time. THEN I checked task manager, and noticed that it always shows this process at 50% cpu utilization, even when there is plenty of idle processing available.
There are no delays in the script and I have "SetBatchLines -1", but the process still only consumes a maximum of 50% of the CPU at any given time.
So, is there another way to speed up this process? Is this 50% cap a built-in function of AHK that can be dissabled?
I've tried manually setting the priority higher than normal and compiling the script, but neither has an effect. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Wed Oct 31, 2007 3:29 am Post subject: |
|
|
what kinds of commands are in your script? there may be other ways to improve speed. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
maximina
Joined: 17 Oct 2007 Posts: 16
|
Posted: Wed Oct 31, 2007 3:43 am Post subject: |
|
|
| engunneer wrote: | | what kinds of commands are in your script? there may be other ways to improve speed. |
There isn't anything extravagant. I've been optimizing it for quite some time, even to the point of calculating different sections of the database in different ways because some ways are faster at certain points... I broke down every function I'd created and put timers on each of them, re-wrote them dozens of times to trim a few milliseconds off of each of them. I just don't think it can be optimized much further...
BUT, if I'm stuck at using a maximum of 50% per script, maybe I'll make it split off into two, one working on the second half of the database... It's the only idea I have left.  |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Wed Oct 31, 2007 3:56 am Post subject: |
|
|
that didn't answer my question.
do you have a dual core processor? that would limit your script to 50% _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
maximina
Joined: 17 Oct 2007 Posts: 16
|
Posted: Wed Oct 31, 2007 3:59 am Post subject: |
|
|
| engunneer wrote: | that didn't answer my question.
do you have a dual core processor? that would limit your script to 50% |
yes... yes I do...
I didn't think that would limit it, because affinity has the process on both cores... So, does ahk only run on one core? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Wed Oct 31, 2007 6:42 pm Post subject: |
|
|
it would be my guess that it only runs on one cpu. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|