Jump to content

Compiled (exe) more slow than .au3?


Recommended Posts

Hi!

With the code under-mentioned, the compiled version is 80% more slowly than the .au3 version.

Is it normal?

#NoTrayIcon
AutoItSetOption("WinTitleMatchMode", 3)
$begin = TimerInit()
For $i=1 to 1000
    $handle=ControlGetHandle("called", "",3)
    If @error Then
        MsgBox(4096, "Error", "Ne trouve pas le contrôle")
    Else
        ControlSetText("called","",$handle,String($i) & "Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio " & String($i),0)
    EndIf
Next
$dif=TimerDiff($begin)
MsgBox(0,"Temps",$dif)
Link to comment
Share on other sites

  • Moderators

The script you provided... what are we supposed to test that on?

I did my own test 100 of them, and they were within one percent of each other overall.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It would be easier to understand and solve the problem if you explain what you need to do, maybe a different method altogether could solve the problem? Maybe the speeds depends on your physical hardware, so that an old machine and a new gaming PC will have big changes, but we dont know that either

Link to comment
Share on other sites

  • Moderators

It stands to reason that the compiled version (this being an interpreted language) is going to be slower, but that's quite a significance there.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi, Valik!

You are right: AutoIt "not-beta" are faster than the light beta-releases (for compiled & not-compiled scripts).

I repeat my tests, with not-beta version: no significant diff between compiled/not-compiled, and 40% faster than beta...

If I had to guess, I would say you are running using a current beta and compiling using 3.2.0.1. The beta caches things which can speed up scripts tremendously.

Edited by Michel Claveau
Link to comment
Share on other sites

I'm sorry, but that's not possible. The beta versions are faster. The beta uses a new caching system which speeds up virtually all scripts and some scripts will notice significant speed improvements. There's simply no way that 3.2.0.1 is 40% faster than 3.2.1.13.

Link to comment
Share on other sites

Hi!

With the code under-mentioned, the compiled version is 80% more slowly than the .au3 version.

Is it normal?

#NoTrayIcon
AutoItSetOption("WinTitleMatchMode", 3)
$begin = TimerInit()
For $i=1 to 1000
    $handle=ControlGetHandle("called", "",3)
    If @error Then
        MsgBox(4096, "Error", "Ne trouve pas le contrôle")
    Else
        ControlSetText("called","",$handle,String($i) & "Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio " & String($i),0)
    EndIf
Next
$dif=TimerDiff($begin)
MsgBox(0,"Temps",$dif)
If speed is the issue is it possible to change your code to

#NoTrayIcon
AutoItSetOption("WinTitleMatchMode", 3)
$handle=ControlGetHandle("called", "",3)
If @error Then
    MsgBox(4096, "Error", "Ne trouve pas le contrôle")
    Exit
Endif
$text="Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio Azertyuio "
$begin = TimerInit()
For $i=1 to 1000
    $result=ControlSetText("called","",$handle,String($i) & $text & String($i),0)
    If $result=0 Then
        MsgBox(4096, "Error", "Ne trouve pas le contrôle")
        ExitLoop
    EndIf
Next
$dif=TimerDiff($begin)
MsgBox(0,"Temps",$dif)
Edited by tresa
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...