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 

Question About Python vs AHK

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Rhys



Joined: 17 Apr 2007
Posts: 707
Location: Florida

PostPosted: Tue Mar 18, 2008 2:56 am    Post subject: Question About Python vs AHK Reply with quote

I'm trying to learn a bit of Python (so far, it's a bit less intuitive than AHK but I've only given it 20 minutes). I honestly think that AHK has spoiled me for other programming languages since it is so forgiving (usually) and well documented (not to mention having a very helpful community).

Here's a question I'm curious about - People often mention that since AHK is an interpreted language, it's not the best choice for raw speed.

Would Python be faster than AHK at performing LOTS of string comparisons, like parsing a file with 10,000 entries in it, comparing it to a (much) larger file with perhaps a million or more entries in it and recreating the original file with no entries that match?

I understand that writing raw machine code would probably be the fastest way to do some really intensive stuff like that (right?) but I don't want to get in above my head.

What would Python be much better at doing than AHK would?
_________________
[Join IRC!]
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2492
Location: Australia, Qld

PostPosted: Tue Mar 18, 2008 5:59 am    Post subject: Reply with quote

Quote:
People often mention that since AHK is an interpreted language, it's not the best choice for raw speed.
I know nothing about Python, but I would like to point out that AutoHotkey is not "interpreted" in the sense you might expect.
Chris wrote:
AHK is written to be a semi-compiled language, which means that much of the interpreting is done the moment the script is launched. This allows the runtime performance of a script -- especially loops with thousands of interestions --to really fly because each line has already been pre-interpreted.

Rhys wrote:
Would Python be faster than AHK at ...
I think the only way you'll find that out is by benchmarking it. Smile
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 948

PostPosted: Tue Mar 18, 2008 8:56 am    Post subject: Reply with quote

I know very little about Python except where I've seen it used. In that sense, I have seen python used in several big-name games to parse huge configuration settings and ""moddable"" datafiles. I really have no idea whether python would be faster than AHK at handling strings, but it may be that the limiting factor would come down to the HDD speed for both languages Razz

Probably the only way to find out would be to try it.
_________________
My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat 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