Jump to content

Optimize code to go faster


akorx
 Share

Recommended Posts

Hi,

I'm french... so sorry for my bad english.

How can we optimize compilation to have an exe that go faster ? I don't know which verb to use : "accelerate" ? "speed up" ?

For exemple (it's just a exemple) : imagine you want to count to 1 to 10000000000... you make your .exe and run it and you see that it takes 60s to do the job... how make it go faster? Are there options during compilation that optimize size or speed of your program ?

I know that the best way is to use assembly code but it's very difficult to use...

Edited by akorx

AkorxMail akorx@yahoo.fr

Link to comment
Share on other sites

It is in the nature of Autoit to take a relative long time to finish a loop like

For $i = 0 to 2147483647
Next

and you cannot speed it up using native Autoit commands!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

And what about the compilation... in C++ for exemple you can choose between size or speed when you are complinig your program.

AutoIt is not a compiled language. Once you understand that, everything becomes a lot easier to understand in this thread.

When you "compile" an exe, you are (in simple terms) embedding the script in the interpreter. When you run the "compiled" result, the interpreter does what it normally does, only with the script.

This has several advantages. Firstly, we can both compile and interpret our scripts, and there won't be difference between the two (unless you use @Compiled or something similar). Second, we can run other scripts using the interpreter in an "compiled" exe. This is very useful when you need to use multiple files.

The disadvantages are that AutoIt will never be lightning fast. You will have to rely on clever coding, or using other languages with AutoIt. If you search the forums for embedding machine code in AutoIt I'm sure you'll find some examples, people have done quite a lot of work on it.

Link to comment
Share on other sites

Even still a little bit faster should be

#AutoIt3Wrapper_Run_Obfuscator=y

#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0

but it is not a solution to speed up Autoit as Mat mentioned it is an interpreter language which will interpret your code in real time. Interpreter and scripting code will be saved in the exe.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

UPX compresses the exe and of course it takes some more milli seconds to unpack and start the exe. A non packed exe starts faster than a packed exe but I think not relevant for Autoit executables.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...