AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using more than 50% of the CPU

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
maximina



Joined: 17 Oct 2007
Posts: 16

PostPosted: Wed Oct 31, 2007 3:17 am    Post subject: Using more than 50% of the CPU Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Wed Oct 31, 2007 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
maximina



Joined: 17 Oct 2007
Posts: 16

PostPosted: Wed Oct 31, 2007 3:43 am    Post subject: Reply with quote

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. Sad
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Wed Oct 31, 2007 3:56 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
maximina



Joined: 17 Oct 2007
Posts: 16

PostPosted: Wed Oct 31, 2007 3:59 am    Post subject: Reply with quote

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
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Wed Oct 31, 2007 6:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group