Jump to content
Sign in to follow this  
WolfWorld

Autoit Optimize

Recommended Posts

WolfWorld

No longer supported please use Eat Spaghetti instead, it better and faster with more function.

Here is my first version of Autoit Optimize.

It's like Obfuscator but instead of slowing it down. It's making your script run faster.

How does this works? Autoit is a Thrid-Level language which at least what I called.

It does not compile your code to Machine Code nor Byte alike code at any given time.

So it need to read your Variables and Functions over and over and over. The shorter the name the better.

So this is what this script does.

It also work on script that passes Obfuscator but it need work around I will explain later on.... Am going to sleep now. See ya!

Just wrote it so sleepy.

Here is the things I fixed before release(I think you should know)

Replacing error, if replace $i before $iLoveYou it will not replace $i

LoveYou again. This is fixed by using sort function (bigger first).

Support Object type in Autoit like $test.Process.Hello

Support functions renaming also. (You can't use #include with this

tool. You will have to put all of the conntent in one file, or use

Obfuscator to do it.)

Support more than 26 + 26*26 Variable by adding the thrid charactor.

So it becomes 26 + 26*26 + 26*26*26 Which is enough for Obfuscator.

Support Obfuscator also but need work around. Here is how.

Obfuse you code by youself and open.

Search for _()

You will see FOR below it.

and you will see a Variable below FOR copy that.

Optimize you script and open the newly optimized script.

Goto the exact same line. Replace that variable with the one that I

told you. And also replace the variable in the FileInstall with the

same one on your ClipBoard.

Now you can run it normally.

Autoit Optimize_Release.exe

Edited by athiwatc

Share this post


Link to post
Share on other sites
Zisly

Has anyone tested this?

Share this post


Link to post
Share on other sites
trancexx

Has anyone tested this?

You?

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Zisly

You?

Nope, I don't dare to test it >_<

Share this post


Link to post
Share on other sites
trancexx

Nope, I don't dare to test it >_<

That's pathetic, you know.

It works. Renames variables and functions to shorter, nothing more.

Bad thing is that includes $CmdLineRaw or $CmdLine and for example used constants from included scripts.

I find it to be redundant.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Zisly

That's pathetic, you know.

It works. Renames variables and functions to shorter, nothing more.

Bad thing is that includes $CmdLineRaw or $CmdLine and for example used constants from included scripts.

I find it to be redundant.

In which way is it pathetic?

I just don't like downloading things without being sure it's safe.

Share this post


Link to post
Share on other sites
Wus

@Zisly

You ought to check out VirtualBox as it would allow you to run the executable in a safe environment. A bit of work to set up, but I bet you would find it endlessly useful.

@trancexx

Calling someone pathetic in such a cavalier manner is well (I hate to be cliche) but pathetic.

Edited by Wus

Share this post


Link to post
Share on other sites
trancexx

@trancexx

Calling someone pathetic in such a cavalier manner is well (I hate to be cliche) but pathetic.

Interesting. How come?

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Wus

Interesting. How come?

You insult someone without offering any aid whatsoever thus showing that your motives are not in fact benevolent, which I find pathetic since it means that you probably just threw the insult in there for an ego-trip.

Meh, maybe I am reading it all wrong -- I just felt that giving a little information would be more helpful than belittling someone.

Consider this my EOF marker for this thread.


Share this post


Link to post
Share on other sites
trancexx

You insult someone without offering any aid whatsoever thus showing that your motives are not in fact benevolent, which I find pathetic since it means that you probably just threw the insult in there for an ego-trip.

Meh, maybe I am reading it all wrong -- I just felt that giving a little information would be more helpful than belittling someone.

Consider this my EOF marker for this thread.

You did read my whole pathetic post?

Since you EOF-ed I suppose there is no point in me explaining to you why I find Zisly's reaction pathetic.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
WolfWorld

That's pathetic, you know.

It works. Renames variables and functions to shorter, nothing more.

Bad thing is that includes $CmdLineRaw or $CmdLine and for example used constants from included scripts.

I find it to be redundant.

Don't worry i will update it soon.

The script now can't read into the #include (yet).

And if you can tell me all the Autoit Variables (Like $CmdLine) I will update it.

AND NO I Don't program viruses! Nobody ever trust me >_<

And Why is it that every topic I open there is going to be a fight or something similar!

Edited by athiwatc

Share this post


Link to post
Share on other sites
Szhlopp

Don't worry i will update it soon.

The script now can't read into the #include (yet).

And if you can tell me all the Autoit Variables (Like $CmdLine) I will update it.

AND NO I Don't program viruses! Nobody ever trust me :(

And Why is it that every topic I open there is going to be a fight or something similar!

Looks cool. I don't have time to fully test it right now, but great job!

And I don't know why people have to fight over everything. I would ask a mod to remove all the useless random posts knocking eachother. It's rediculous, childish and all around stupid >_<

Share this post


Link to post
Share on other sites
WolfWorld

Looks cool. I don't have time to fully test it right now, but great job!

And I don't know why people have to fight over everything. I would ask a mod to remove all the useless random posts knocking eachother. It's rediculous, childish and all around stupid >_<

Thanks I will update it soon with more optimize support.

Share this post


Link to post
Share on other sites
Jos

Serious question: How much will a shorter variable name speed up the process? In other words: did anybody do speed tests and is able to share the script and the results?

It is for me trivial to change Obfuscator to support the creation of short variable names in stead of the "hard-to-read" variable names.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Melba23

Jos,

Out of interest I just ran this very short and pretty unrepresentative test:

$sShort = 0
$sVeryMuchLongerVariable = 0

$nBegin = TimerInit()
For $i = 1 To 10000000
    $sShort = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

$nBegin = TimerInit()
For $i = 1 To 10000000
    $sVeryMuchLongerVariable = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

The results if I run with the short variable name first:

Short:  3761  3861  3801  3792
Long:   3979  3934  3987  3936

and then with the long variable name first (always a good idea to reverse the order in any experiment*):

Short:  3760  3789  3844  3759
Long:   3968  4016  4031  4016

Seems pretty clear that the shorter name is faster in this test by about 5% - which I find very surprising. >_<

M23

* See RV Jones' book - Most Secret War


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Zisly

So naming your variable $1,$2 would be the best way?

Share this post


Link to post
Share on other sites
Skrip

Jos,

Out of interest I just ran this very short and pretty unrepresentative test:

$sShort = 0
$sVeryMuchLongerVariable = 0

$nBegin = TimerInit()
For $i = 1 To 10000000
    $sShort = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

$nBegin = TimerInit()
For $i = 1 To 10000000
    $sVeryMuchLongerVariable = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

The results if I run with the short variable name first:

Short:  3761  3861  3801  3792
Long:   3979  3934  3987  3936

and then with the long variable name first (always a good idea to reverse the order in any experiment*):

Short:  3760  3789  3844  3759
Long:   3968  4016  4031  4016

Seems pretty clear that the shorter name is faster in this test by about 5% - which I find very surprising. >_<

M23

* See RV Jones' book - Most Secret War

$s = 0
$sVeryMuchLongerVariableeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee = 0

$nBegin = TimerInit()
For $i = 1 To 10000000
    $s = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

$nBegin = TimerInit()
For $i = 1 To 10000000
    $sVeryMuchLongerVariableeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee = 1
Next
ConsoleWrite(TimerDiff($nBegin) & @CRLF)

3032.95090577154

3517.51395777955

Huh....wow. Big difference. Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
nfaustin

I got Error when run and compiling my script:

;From Original code
Global $input1 = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN))

;To Optimize code
Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY, $J, $BX, $BW))

And this are the Errors:

E:\Tool_Optimize.au3(58,63) : WARNING: $BY: possibly used before declaration.
Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\Tool_Optimize.au3(58,67) : WARNING: $J: possibly used before declaration.
Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY, $J,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\Tool_Optimize.au3(58,72) : WARNING: $BX: possibly used before declaration.
 Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY, $J, $BX, 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^  
E:\Tool_Optimize.au3(58,77) : WARNING: $BW: possibly used before declaration.  
Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY, $J, $BX, $BW) 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 
E:\Tool_Optimize.au3(58,63) : ERROR: $BY: undeclared global variable. 
Global $BE = GUICtrlCreateEdit("", 5, 165, 450, 155, BitOR($BY, 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Edit:

Any ideas?

Edited by nfaustin

[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

isn't that a case of - works as designed? It is normal that the interpreter needs to read the variable every time. Therefor the longer the variable the more time it takes. It reads line by line, or is there any kind of optimzing processes done on compile time? I think there is nothing, cause if you decompile the code, it looks the same as before.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
Zedna

Quote

3032.95090577154

3517.51395777955

Huh....wow. Big difference.

Very surprising! That's 16% difference!!

If that's true then Obfuscator should have new option for this optimization.

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  

×