Jump to content

One for the developers: variable name length


qwert
 Share

Recommended Posts

JohnOne, Your test still shows an overhead of about 25% just because of long variable names. That's much more than I would have expected. The overhead in my test is about 125% (this situation seems to be the case for function names in the standard UDFs).

Link to comment
Share on other sites

What Melba said.  Why isn't the au3stripper parameters reversed?  Meaning, var/func renaming be on by default, unless specified otherwise.

Because when your script throws an error, obfuscated variable names make it hard to debug. This kind of optimization should obviously be inside AutoIt and the au3stripper is simply a workaround until such time that the AutoIt interpreter is optimized.
Link to comment
Share on other sites

 
Because when your script throws an error, obfuscated variable names make it hard to debug.

 

Please elaborate.  I don't think a compiled exe will give you the variable names, it just gives the error string and the line number, which is the line number of the exe not your script.

Edited by TouchOdeath
Link to comment
Share on other sites

TouchOdeath Au3Stripper

A compiled exe will only give you the line number if an error occurs.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Developers

What Melba said.  Why isn't the au3stripper parameters reversed?  Meaning, var/func renaming be on by default, unless specified otherwise.

The simply reason is that I don't want to modify variable and func names by default.

Jos

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

Link to comment
Share on other sites

Please elaborate.  I don't think a compiled exe will give you the variable names, it just gives the error string and the line number, which is the line number of the exe not your script.

The performance gained by using short variable names isn't exclusive to compiled scripts. For example, I exclusively run straight from source.

Link to comment
Share on other sites

  • 2 weeks later...

Another important thing is reuse variable if doesn't needed anymore on next sequence.

Variable given name such as $_, $__, $___, $____, $_____ and etc. Unreadable aren't it :)

Func dontlook_a()
   Local $_ = 'long text...' & _
              'long text...' & _
              'long text...' & _
              'long text...' & _
              'long text...'
   ; do something else with $_
EndFunc

Func dontlook_b()
   Local $_
   $_  = 'long text...'
   $_ &= 'long text...'
   $_ &= 'long text...'
   $_ &= 'long text...'
   $_ &= 'long text...'
   ; do something else with $_
EndFunc
Edited by prazetto

# Button. Progressbar - Graphical AutoIt3 Control (UDF) # GTK on AutoIt3 - GTK+ Framework | Widgets

cig computer instruction graphics  http://code.hstn.me

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