Sign in to follow this  
Followers 0
Michel Claveau

Compiled (exe) more slow than .au3?

11 posts in this topic

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)

Share this post


Link to post
Share on other sites



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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Hi!

I save the script like essai.au3 ; run give 7 seconds

I compile to essai.exe ; run give 13 seconds

I test ten times the test, with little differences, but the same ratio

I conclude than compiled version are more slowly.

Perhaps, am I wrong?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

It stands to reason that the compiled version (this being an interpreted language) is going to be slower...

Please explain why should there be a speed difference between compiled and uncompiled? ;)

Share this post


Link to post
Share on other sites

Things could have changed since this post:

http://www.autoitscript.com/forum/index.ph...post&p=3061

Disconnect from the NET, scan drive with Antivirus (AV) tool, turn off or uninstall any AV tools - especially any with a heuristic feature... then repeat your tests.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0