| View previous topic :: View next topic |
| Author |
Message |
Rhys
Joined: 17 Apr 2007 Posts: 707 Location: Florida
|
Posted: Tue Mar 18, 2008 2:56 am Post subject: Question About Python vs AHK |
|
|
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 |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2492 Location: Australia, Qld
|
Posted: Tue Mar 18, 2008 5:59 am Post subject: |
|
|
| 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.  |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 948
|
Posted: Tue Mar 18, 2008 8:56 am Post subject: |
|
|
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
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 |
|
 |
|