Jump to content

Inline Assembler Snippets


UEZ
 Share

Recommended Posts

In my distant past, 20 years ago, I was programming in assembler for Motorola 68000 Amiga500, even I created a GUI interface with Amiga OS system API.
Some time ago, seeing this your topic, I wanted to recall something about assembler, so I read the tutorials, but in the end I did not have time then to finish my education in this field.

I recently had some problems with StringReverse, but now in principle, can be considered as solved.

However today, when this, your topic appeared again on the surface of the forum, I thought, if it would be better to use ASM, and act directly on the binary data without having to perform additional operations, which so far I had to do when I use StringReverse function.

So that's why I just asked you here.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

 

On 6/21/2016 at 10:09 PM, mLipok said:

I recently had some problems with StringReverse, but now in principle, can be considered as solved.

This is not directly ASM related but I created a StringReverse function with FreeBasic which you may test.

$sText = "Hello World"

If Not FileExists("StringReverse.dll") Then _DLL(True)
$aReturn = DllCall("StringReverse.dll", "str", "StringReverse", "str", $sText)

ConsoleWrite($aReturn[0] & @CRLF)

;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2015-09-19

Func _DLL($bSaveBinary = False, $sSavePath = @ScriptDir)
    Local $DLL
    $DLL &= 'WrkATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAgAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGAFBFAABMAQkAEMpCclcFV+AADoAjCwECGQAoAAyCRgADWgAAEBQAB6oQBpgQAgsCA7cBBL/nAxkADQAMZ2ACHgQ0BAODAQYEDQDAAABSAQeK0IB5BZlyAQD4AyRBEgAE8AAAGJEL0QgAAMiYKi50ZXjydIADbCcESIF1BmIDAABgAFBgLmRhdFphgAUcBcqBRSyLE0AgADDALnIDFGwKGwGqgAEMATKOE0AuYmRzc4EF1FkCMJTrcHjALmXDE8JIwErCHTqd0BNpwwnCUMBSAAbAAGI80CdDUlTBAoIu4KXEE0LQCXRswicgAQELwFbCCUTRO2Vsb2P+AMRmw3zCissJTBg/AD8ABz8APwAHAFOD7BjHBAQkQXnoMBkAAICJw4kEJOh2wE0AhdujyLkAEKMixIAAdA3HgYQAg0DEGDHAW8PAALhBgW5bw5BXViAIEACLVCQkhdJ1cgKhQEoQhcAPjhUBwAOD6AEx24s1DFTRgAjhAusPjXYKAGAN6EAJ/9aD7AQEumEIidjwD7EEFcyADIXAdeGhAtAAAYP4Ag+E42tgA4AFHwETxyBsAg6DAMQQW15fwgwAEIn2jbwhZwCD+kIBIgN15GSh4XAxQPaLWASLPYEO64IX4A052A+EDAAEpeUO1+AOifBADh1EDgjeMduEDgEPhCFnIAWiAWAYhPHACUcDF0FAA4XbD4TLoQIwElBBBHQc4B4ox0SEJASBUIlUJAjgAQAgiRQk/9CD7OgMgwWBHgFAFmMl4hYAkDHA6Tf///9N5hehYSxBLvMa4AvAYInGdEGhIS5BAuABQAKJw4PrBDneAHcPixOF0nTzAYAB/9I53nbxiaA0JOiIF+AaBaEFG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WinAPI_Base64Decode($DLL)
    If @error Then Return SetError(1, 0, 0)
    Local $tSource = DllStructCreate('byte[' & BinaryLen($DLL) & ']')
    DllStructSetData($tSource, 1, $DLL)
    Local $tDecompress
    _WinAPI_LZNTDecompress($tSource, $tDecompress, 18944)
    If @error Then Return SetError(3, 0, 0)
    $tSource = 0
    Local Const $bString = Binary(DllStructGetData($tDecompress, 1))
    If $bSaveBinary Then
        Local Const $hFile = FileOpen($sSavePath & "\StringReverse.dll", 18)
        If @error Then Return SetError(2, 0, $bString)
        FileWrite($hFile, $bString)
        FileClose($hFile)
    EndIf
    Return $bString
EndFunc   ;==>_DLL

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize)
    $tOutput = DllStructCreate("byte[" & $iBufferSize & "]")
    If @error Then Return SetError(1, 0, 0)
    Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0)
    If @error Then Return SetError(2, 0, 0)
    If $aRet[0] Then Return SetError(3, $aRet[0], 0)
    Return $aRet[6]
EndFunc   ;==>_WinAPI_LZNTDecompress

 

This is the ASM code generated by FreeBasic which is not complete listed:

.intel_syntax noprefix

.section .text
.balign 16

.globl _DllMain@12
_DllMain@12:
push ebp
mov ebp, esp
sub esp, 4
mov dword ptr [ebp-4], 0
.Lt_0004:
mov dword ptr [ebp-4], 1
cmp dword ptr [ebp+12], 1
jne .Lt_0006
push 0
push 0
call _main
add esp, 8
.Lt_0006:
.Lt_0005:
mov eax, dword ptr [ebp-4]
mov esp, ebp
pop ebp
ret 12
.balign 16

.globl _StringReverse
_StringReverse:
push ebp
mov ebp, esp
sub esp, 8
mov dword ptr [ebp-4], 0
.Lt_0007:
push 0
push dword ptr [ebp+8]
call _fb_StrLen@8
mov dword ptr [ebp-8], eax
jmp .Lt_0009
.Lt_000C:
push 0
push -1
push 1
push dword ptr [ebp-8]
push dword ptr [ebp+8]
call _fb_StrAllocTempDescZ@4
push eax
call _fb_StrMid@12
push eax
push -1
push offset _sReverse
call _fb_StrConcatAssign@20
.Lt_000A:
add dword ptr [ebp-8], 4294967295
.Lt_0009:
cmp dword ptr [ebp-8], 1
jae .Lt_000C
.Lt_000B:
mov eax, dword ptr [_sReverse]
mov dword ptr [ebp-4], eax
.Lt_0008:
mov eax, dword ptr [ebp-4]
mov esp, ebp
pop ebp
ret 4
.balign 16
_main:
push ebp
mov ebp, esp
and esp, 0xFFFFFFF0
sub esp, 4
mov dword ptr [ebp-4], 0
call ___main
push 0
push dword ptr [ebp+12]
push dword ptr [ebp+8]
call _fb_Init@12
.Lt_0002:
.Lt_0003:
mov eax, dword ptr [ebp-4]
mov esp, ebp
pop ebp
ret

.section .bss
.balign 4
    .lcomm  _sReverse,12

.section .drectve
    .ascii " -export:StringReverse"

 

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

Here is my modified version:

_Example()
Func _Example()
    Local $sFileFullPath = FileOpenDialog('Choose file',@ScriptDir,'Files (*.*)')
    If @error Then Return -1

    Local $sText = FileRead($sFileFullPath)
    ConsoleWrite("! FileSize=" & FileGetSize( $sFileFullPath) & @CRLF)
;~  Local $sText = "Hello World"

    If Not FileExists("StringReverse.dll") Then _DLL(True)
    Local $hTimer, $fDiff

    $hTimer = TimerInit()
    Local $aReturn = DllCall("StringReverse.dll", "str", "StringReverse", "str", $sText)
    ConsoleWrite("! Time 1=" & TimerDiff($hTimer) & @CRLF)

    $hTimer = TimerInit()
    StringReverse($sText)
    ConsoleWrite("! Time 2=" & TimerDiff($hTimer) & @CRLF)

;~  ConsoleWrite($aReturn[0] & @CRLF)

EndFunc   ;==>_Example

;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2015-09-19
Func _DLL($bSaveBinary = False, $sSavePath = @ScriptDir)
    Local $DLL
    $DLL &= 'WrkATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAgAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGAFBFAABMAQkAEMpCclcFV+AADoAjCwECGQAoAAyCRgADWgAAEBQAB6oQBpgQAgsCA7cBBL/nAxkADQAMZ2ACHgQ0BAODAQYEDQDAAABSAQeK0IB5BZlyAQD4AyRBEgAE8AAAGJEL0QgAAMiYKi50ZXjydIADbCcESIF1BmIDAABgAFBgLmRhdFphgAUcBcqBRSyLE0AgADDALnIDFGwKGwGqgAEMATKOE0AuYmRzc4EF1FkCMJTrcHjALmXDE8JIwErCHTqd0BNpwwnCUMBSAAbAAGI80CdDUlTBAoIu4KXEE0LQCXRswicgAQELwFbCCUTRO2Vsb2P+AMRmw3zCissJTBg/AD8ABz8APwAHAFOD7BjHBAQkQXnoMBkAAICJw4kEJOh2wE0AhdujyLkAEKMixIAAdA3HgYQAg0DEGDHAW8PAALhBgW5bw5BXViAIEACLVCQkhdJ1cgKhQEoQhcAPjhUBwAOD6A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WAABDAlMDcwQwAwXzBoMIwwrAAwxDDaMO4wCgAxEDEWMR8xJQAxWDFeMXExpVAxtDG58CDJ8BX1ADETMhkyHzJEADJKMnEydzKHADKpMsEyzjLYADLzMv0yCDMOADMhMyszQzNJADMNNCE0LzQ1ADQ8NJk0sTTFADTKNOU08TT/ADQGNRY1MTU/ADVFNUw1ljWjADWvNcU11DXoADXtNSs2QTZPAXAjZDZzNqI2/gA2BjcONxY3HgA3JjcuN1Q3WAA3ZDcAQAAADJMxLPALAFCiLAAosCAKMPEA4PMADDAYMAoc8QDw8wAEMAgw+AwwEBEBDwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAAcPAA8ABgA='
    $DLL = _WinAPI_Base64Decode($DLL)
    If @error Then Return SetError(1, 0, 0)
    Local $tSource = DllStructCreate('byte[' & BinaryLen($DLL) & ']')
    DllStructSetData($tSource, 1, $DLL)
    Local $tDecompress
    _WinAPI_LZNTDecompress($tSource, $tDecompress, 18944)
    If @error Then Return SetError(3, 0, 0)
    $tSource = 0
    Local Const $bString = Binary(DllStructGetData($tDecompress, 1))
    If $bSaveBinary Then
        Local Const $hFile = FileOpen($sSavePath & "\StringReverse.dll", 18)
        If @error Then Return SetError(2, 0, $bString)
        FileWrite($hFile, $bString)
        FileClose($hFile)
    EndIf
    Return $bString
EndFunc   ;==>_DLL

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize)
    $tOutput = DllStructCreate("byte[" & $iBufferSize & "]")
    If @error Then Return SetError(1, 0, 0)
    Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0)
    If @error Then Return SetError(2, 0, 0)
    If $aRet[0] Then Return SetError(3, $aRet[0], 0)
    Return $aRet[6]
EndFunc   ;==>_WinAPI_LZNTDecompress

 

And the results are:

Quote

! FileSize=57963
! Time 1=1397.37528764505
! Time 2=68.8263892860164

Why ASM is so slow ?
Is this mean FreeBasic/ASM is not well optimized in comparision to AutoIt/C++ ?

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

8 minutes ago, mLipok said:

Why ASM is so slow ?
Is this mean FreeBasic is not well optimized in comparision to C++ ?

 

This is the result of the compiled version which "has been rated close in speed with mainstream tools, such as GCC". Maybe I used the wrong compiler settings.

 

I will do also some tests and reply later again.

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

14 minutes ago, UEZ said:

I will do also some tests and reply later again.

Promises to be interesting.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I assume that StrPtr is causing that huge difference.

Global $sText

For $i = 0 to 222222
    $sText &= Chr(33 + Mod($i, 94))
Next

If Not FileExists("StringReverse.dll") Then _DLL(True)
$hDLL = DllOpen("StringReverse.dll")

$fTimer = TimerInit()
$aReturn = DllCall($hDll, "str", "StringReverse", "str", $sText)
$fEnd1 = TimerDiff($fTimer)

$fTimer = TimerInit()
$sResult = StringReverse($sText)
$fEnd2 = TimerDiff($fTimer)

ConsoleWrite(@CRLF)
ConsoleWrite("FreeBasic: " & Round($fEnd1, 2) & " ms" & @CRLF)
ConsoleWrite("AutoIt: " & Round($fEnd2, 2) & " ms" & @CRLF)
ConsoleWrite("Factor: " & Round($fEnd1 / $fEnd2, 2) & @CRLF)

DllClose($hDLL)


;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2015-09-19

Func _DLL($bSaveBinary = False, $sSavePath = @ScriptDir)
    Local $DLL
    $DLL &= 'wbkATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAgAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGAFBFAABMAQkAEDjDclcFV+AADoAjCwECGQBCAAyCZgADXAAAEBQAB6oQAANgAiIQAgsCA7c2AQS/AgAwAA0ADMk0fgEBHgQ0BAMBBgQNAGQAglIBB/AAAOgGGHIwIAEArAGQFAAEEAgBABiQCyjxAACC7BgrLnRleHSAAz78AbQBSIF1BmIDAGAAgFBgLmRhdGGABSZMAwiCeQBGixNAAJAwwC5yAxT0DgAICnCEKUiNE0BALmJkc3OBBRRaBODSdXB4wC5lwxPCSMBKwh1Ycc4dQC5pwwnCUMBSAI4IwADBFs0nQ1JUwQIuLEIEwGjBE2LQCXRsLcInIAJqxAlk0TtlbPhvYwDDZsBowk7BissJP0FVPwA/AD8APwASAFODIOwYxwQkIUHo+AAyAACJw4kEJADoNjYAAIXbo0AI2gAQowSAAHQEDcdiYIPEGDHAFFvDwAC4gW5bw5AEV1YgCBCLVCQkIIXSdXKhYEcQhRDAD44VwAOD6AHAMduLNZDxgAjhAqDrD412AGAN6EAJQP/Wg+wEumEIiUDY8A+xFQyADIUgwHXhoRAAAYP4sAIPhONgA4AFHwETBo8AEwIOg8QQW14AX8IMAIn2jbwSJyIS+gEiA3XkZAKh4XA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IArDLBMtIy4jIA6jLyMvoyAjMACjMSMxozIjMAKjMyMzozRTMAazN8M7czzzMA6TMoNEY0WzQIbDR0sB2LNK40ALM02DToNPk0AP40AzULNRA1ABg1ITUrNTE1ADo1SzW2NcM1AOI16DX9NWU2AIA2nTbINtY2ABc3RTdSN3c3AJQ3oTe2N703CMs33ZAfATgbOAA8OE44UzhYOABvOHw4ijiPOACcOLE4vjjEOADxOAk5DzkfOQAlOTY5PDlDOQBVOV85iTmgOYC6OcQ55Tn3MBsAHzooOkw6bDoAhDqaOq46yjoA0DrWOt865ToAGDseOzE7ZTsAdDt5O4I7iTsAkju1O9M72TuA3zsEPAo8MRAmAEc8aTyBPI48AJg8szy9PMg8AM484TzrPAM9CAk9zRAU7z31PQD8PVk+cT6FPgCKPqU+sT6/PgDGPtY+8T7/PgAFPww/Vj9jPwBvP4U/lD+oPwitP+vxFVAAACgBYAABMA8wFTAkBDAz8DOSMJowogAwqjCyMLowwgAw5DDoMPQwADBgAAAM4SDwIABwCAAAHGAATDBQMABUMFgwXDBgMIBkMHAwdDB40AGCAQJ3DDAYMByxAgIQ8wAEMAgwDDB+EBEBDwAPAA8ADwAGAA=='
    $DLL = _WinAPI_Base64Decode($DLL)
    If @error Then Return SetError(1, 0, 0)
    Local $tSource = DllStructCreate('byte[' & BinaryLen($DLL) & ']')
    DllStructSetData($tSource, 1, $DLL)
    Local $tDecompress
    _WinAPI_LZNTDecompress($tSource, $tDecompress, 27136)
    If @error Then Return SetError(3, 0, 0)
    $tSource = 0
    Local Const $bString = Binary(DllStructGetData($tDecompress, 1))
    If $bSaveBinary Then
        Local Const $hFile = FileOpen($sSavePath & "\StringReverse.dll", 18)
        If @error Then Return SetError(2, 0, $bString)
        FileWrite($hFile, $bString)
        FileClose($hFile)
    EndIf
    Return $bString
EndFunc   ;==>_DLL

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize)
    $tOutput = DllStructCreate("byte[" & $iBufferSize & "]")
    If @error Then Return SetError(1, 0, 0)
    Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0)
    If @error Then Return SetError(2, 0, 0)
    If $aRet[0] Then Return SetError(3, $aRet[0], 0)
    Return $aRet[6]
EndFunc   ;==>_WinAPI_LZNTDecompress

 

Delete the old DLL.

 

My result:

FreeBasic internal benchmark: 9.416275106559624 ms.

FreeBasic: 9419.97 ms
AutoIt: 144.37 ms
Factor: 65.25

 

FreeBasic code:

Extern "Windows-MS"

Dim Shared As String sReverse

Function StringReverse(sString As ZString Ptr) As ZString Ptr Export
    Dim As Double fStart, fEnd
    fStart = Timer
    For i As Uinteger = Len(*sString) To 1 Step - 1
        sReverse &= Mid(*sString, i, 1)
    Next
    fEnd = Timer - fStart
    Print "FreeBasic internal benchmark: " & fEnd & " ms."
    Return StrPtr(sReverse)
End Function


End Extern

 

Compiler options: fbc -s gui -dll -export -RR -fpu SSE -vec 2

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

1 hour ago, UEZ said:

Print "FreeBasic internal benchmark: " & fEnd & " ms."

 

Quote

Returns a Double precision result with the time, in seconds, since a static reference point.

little mistake ?


So I se there is not always so fast using outside feature/functions/dll.
Sometimes internal AutoIt solutions are better/faster.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I assume that my FB code is shit and thus the worse performance and it can be coded much better which I don't know yet.

 

Or you can try to implement StringReverse completely in ASM which seems not to be a simple task because of unicode support at least for me.

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

30 minutes ago, UEZ said:

I assume that my FB code is shit and thus the worse performance and it can be coded much better which I don't know yet.

You are making self critic?

Or you are trying to tell me that I was using "wrong wording"?

I'm little confused. 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

8 minutes ago, mLipok said:

You are making self critic?

Yep. I'm new to FB and talked about my FB code. :rolleyes:

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

Hi,

@mLipok, long time ago I tried to beat the AutoIt-String-Functions with ASM-Scripts, and fortunately ( ! ) it´s not worth the work....i worked with strings up to 100MB size, the shorter the string, the (relative) bigger the overhead of the DllCallAddress().....the shorter the string, the faster the internal (string!-)functions!

The stringfunctions in AutoIt are VERY fast, thanks to all the programmers in the last 30 years to optimize their code and (used by AutoIt) C-librarys!

 

If you have an ANSI-String (one Byte=one Letter), you should absolutely use the StringReverse()-function with flag=1!

 

But some hints if you want to play with ASM or other compiler-languages or dlls. 

We could call the ASM-code within 2 scenarios:

(1)       DllCallAddress("str:cdecl", $codestructptr, "str*", $ansistring)

where $codestructptr is the address of the ASM-code, $ansistring is the string to reverse and $ansistringlen is.....the stringlen. This forces the Assemblercode to work with a pointer to the pointer of the string. Remember that, if you ever want to play with AutoIt, Assembler and strings. By the "str*" you get the pointer to the pointer....Btw. "str:cdecl" returns the processed string back to Autoit! 

Because of AutoIt´s internal structure, this is the worst way to call a string-related function, because $ansistring got copied before we can work with it. The internal functions first have to reserve memory and copy the string into the memory, this is very "expensive" (in terms of Assembler). But it looks very professional to work with pointers to a string....Only to mention, time to "copy" the 100MB-string takes 1000ms while exchange the letters (reversestring) with ASM-code takes 150ms (on my machine)

But we could do the "stringcopy" by hand, reserve memory with dllstructcreate()  and copy the string into this memory with dllstructsetdata(). And we call our code like this

(2)       DllCallAddress("none:cdecl", $codestructptr, "ptr", $ansistringptr)

This function returns "nothing" because the processed string is in the memory (dllstruct) and can be get by dllstructgetdata()

This makes sense, if we want to work with string(s) in a way that is not supported by native AutoIt-Stringfunctions....

 

Here a simple code which demonstrates the difference of the mentioned above...

$string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"               ;make a 109MB long string
For $i = 1 To 22
    $string &= $string
Next
$stringlen = StringLen($string)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $stringlen = ' & $stringlen & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console


$ptr2string = 123456                                 ;a "pointer", doesn't matter anything...only for example

$struct = DllStructCreate("Byte")                    ;reserve memory
$ptr = DllStructGetPtr($struct)                      ;pointer to memory
DllStructSetData($struct, 1, 0xC3)                   ;write RET(urn) assembler opcode


;now we test a call with pointer(to anything) vs call of string
$t = TimerInit()
DllCallAddress("none:cdecl", $ptr, "str", $ptr2string) ;pointer
$m = TimerDiff($t)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $m = ' & $m & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console


$t = TimerInit()
DllCallAddress("none:cdecl", $ptr, "str*", $string)  ;string
$m2 = TimerDiff($t)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $m2 = ' & $m2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

The time of running a whichever function doing something with a string is wasted if "str*" is used...

If you want do do anything with a string with AutoIt ( HLL/ASM/DLL...), try to get a pointer to that string!

 

 

 

Edited by AndyG
Link to comment
Share on other sites

I'm really a novice when it comes to DllCall feature in AutoIt, as I never used it more then with help others.
But reading your lecture I understand what you stated. The more seeing results.
I just wonder whether it will increased UEZ knowledge , in a way, that as a result he will be able to create something wonderful with his example ;)

I have a great hope.

mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Hello. I think is not so hard to make a fast string reverse. @UEZ you FB function internally does a lot of thing for just reverse a string. I think would be faster do something like:

Create a empty buffer with the needed string size.

then simply  mov byte if is ansi or word if is unicode to my buffer from the source string.

another alternative could be using swapping to reduce loops.

Regards

 

Link to comment
Share on other sites

Here enclosed an example of ASM-Code, very simple, shows the difference between the "external" functions and the advantage of "internal" AutoIt function. The reasons of the different execution speed are mentioned above.

But, if supposed (no, i am really sure ^^) that the AutoIt internal function is able to use the pointer to the string, the execution time is directly dependent to the compiled (I suppose C(++)-) Code. And shown with the attached script, the simplest ASM-code is 50% faster than the "compiled" one (related to reverse the string, no memory-related stuff!). Which is not a wonder, because EVERY M$-(API)Function is overloaded by jumps and calls to other functions, errormanagement, and so on.

If the socalled "Programmer" knows that and is looking for "fast(er) code", M$ provides "intrinsics"-Function which are nothing else than inlined native ASM-opcodes. So you can speedup code 200-300% if only one little piece of code is replaced....

If you have a loop which, for example, calculates trigonometric functions (sin/cos/tan) many many times, replace the C(++)-function  sinf by the corresponding "Intrinsic function" and you can half/third the execution time! Not to mention what the programmer could reach with SSE/AVX....

Ultimately all this does no matter if AutoIt is your preferred language.  In the most cases AutoIt is fast enough, if you really want to speed up your code, profile it, find the "inner loop" and replace the whole loop with a "compiled" function....

 

Script, 32bit-code asm, comparison between call of "str" and "str*"

#AutoIt3Wrapper_UseX64=n
;#include "assembleit2_64.au3"           ;AssembleIt assembler with debugger and much more features at autoit.de


#cs _StringReverse2
    use32                               ;32 bit

    mov esi,[esp+4]                     ;address string adress first letter
    mov ecx,[esp+8]                     ;number of letters

    lea edi,[ecx+esi]                   ;address of last letter
    sub edi,1
    shr ecx,1                           ; = /2 only half the letters to xchg

    _loop:
    mov bl,[edi]                        ;save last letter to change
    mov bh,[esi]                        ;save first letter to change
    mov [edi],bh                        ;change letters
    mov [esi],bl                        ;as usual
    add esi,1                           ;adress second letter...
    sub edi,1                           ;adress penultimate letter...

    sub ecx,1                           ;half the string reached?
    jnz _loop                           ;no, then loop again

    ret

#ce


#cs _StringReverse
    use32                               ;32 bit

    mov esi,[esp+4]                     ;address string adress first letter
    mov esi,[esi]                       ;strings have pointer to a pointer....
    mov ecx,[esp+8]                     ;number of letters

    lea edi,[ecx+esi]                   ;address of last letter
    sub edi,1
    shr ecx,1                           ; = /2 only half the letters to xchg

    _loop:
    mov bl,[edi]                        ;save last letter to change
    mov bh,[esi]                        ;save first letter to change
    mov [edi],bh                        ;change letters
    mov [esi],bl                        ;as usual
    add esi,1                           ;adress second letter...
    sub edi,1                           ;adress penultimate letter...

    sub ecx,1                           ;half the string reached?
    jnz _loop                           ;no, then loop again

    ret

#ce


;make a 100MB string
$string = "ABCD"
For $i = 1 To 44
    $string = $string & Chr($i + 40)    ;String erstellen )*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST
Next

For $i = 1 To 21                        ;pump it up...
    $string &= $string
Next
$string &= "ENDE"
$stringlen = StringLen($string)
ConsoleWrite('$stringlen = ' & $stringlen & " Bytes" & @CRLF & @CRLF) ;### Debug Console


Global $filestructptr, $asm_only

;~ $asmcode = _AssembleIt2("retbinary", "_StringReverse") ;erstellt den asmcode
;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $asmcode = ' & $asmcode & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

$asmcode = "0x8B7424048B3689F08B4C24088D3C3183EF01D1E98A1F8A3E883F881E83C60183EF0183E90175EDC3" ;by AssembleIt
$codestruct = DllStructCreate("byte[" & StringLen($asmcode) / 2 - 1 & "]") ;speicher für asmcode...
DllStructSetData($codestruct, 1, $asmcode) ;...mit code füllen


;~ $asmcode2 = _AssembleIt2("retbinary", "_StringReverse2") ;erstellt den asmcode
;~  ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $asmcode2 = ' & $asmcode2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
$asmcode2 = "0x8B7424048B4C24088D3C3183EF01D1E98A1F8A3E883F881E83C60183EF0183E90175EDC3" ;by AssembleIt
Global $codestruct2 = DllStructCreate("byte[" & StringLen($asmcode2) / 2 - 1 & "]") ;speicher für asmcode...
DllStructSetData($codestruct2, 1, $asmcode2) ;...mit code füllen


;string into memory, we get a pointer
$stringstruct = DllStructCreate("char[" & $stringlen & "]")
$stringptr = DllStructGetPtr($stringstruct)
DllStructSetData($stringstruct, 1, $string)


;~ $t = TimerInit()
;~ $ret = _AssembleIt2("str", "_StringReverse", "str*", $string, "uint", $stringlen)
;~ $m = TimerDiff($t)
;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : time _StringReverse= ' & $m & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

;~ $t = TimerInit()
;~ $ret = _AssembleIt2("none", "_StringReverse2", "ptr", $stringptr, "uint", $stringlen)
;~ $m = TimerDiff($t)
;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : time _StringReverse2 = ' & $m & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console



$t = TimerInit()
$string1 = _StringReverse_ASM($string)
$stringreverseasm = Int(TimerDiff($t))
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $stringreverseasm = ' & $stringreverseasm & "ms   str* - version copies the string internal" & @CRLF & @CRLF) ;### Debug Console

$t = TimerInit()
$string2 = _StringReverse_ASM2($string)
$stringreverseasm2 = Int(TimerDiff($t))
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $stringreverseasm2 = ' & $stringreverseasm2 & "ms    ptr - version needs read/write of dllstruct" & @CRLF & @CRLF) ;### Debug Console

$t = TimerInit()
$string3 = StringReverse($string, 1)
$stringreverseAutoIt = Int(TimerDiff($t))
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $stringreverseAutoIt = ' & $stringreverseAutoIt & "ms  native AutoIt (rulez!!!)" & @CRLF & @CRLF) ;### Debug Console


ConsoleWrite(StringLeft($string1, 50) & @CRLF & StringLeft($string2, 50) & @CRLF & StringLeft($string3, 50) & @CRLF & @CRLF)



Func _StringReverse_ASM($ansistring)    ;str* - version
    $ret = DllCallAddress("str:cdecl", DllStructGetPtr($codestruct), "str*", $ansistring, "uint", StringLen($ansistring))
    Return $ret[0]
EndFunc                                 ;==>_StringReverse_ASM


Func _StringReverse_ASM2($ansistring)   ;ptr - version
    $stringstruct = DllStructCreate("char[" & StringLen($ansistring) & "]")
    $stringptr = DllStructGetPtr($stringstruct)
    DllStructSetData($stringstruct, 1, $string)
    $r = TimerInit()
    $ret = DllCallAddress("int:cdecl", DllStructGetPtr($codestruct2), "ptr", $stringptr, "uint", StringLen($ansistring))
    $asm_only = Int(TimerDiff($r))
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $asm_only = ' & $asm_only & "ms   without memory related stuff like read/write of dllstruct" & @CRLF & @CRLF) ;### Debug Console
    $ret = DllStructGetData($stringstruct, 1)
    Return $ret
EndFunc                                 ;==>_StringReverse_ASM2

 

Simple example of AssembleIt(), possibility for everyone to improve the asm-code ;) . Feel free to write a really "fast" one, SSE/SIMD is recommended, challenge anyone? 1.9clockticks per reversed char atm...

#AutoIt3Wrapper_UseX64=n
#include "assembleit2_64.au3"             ;AssembleIt assembler with debugger and much more features at autoit.de


#cs _StringReverse2
    use32                                 ;32 bit

    mov esi,[esp+4]                       ;address string adress first letter
    mov ecx,[esp+8]                       ;number of letters

    lea edi,[ecx+esi]                     ;address of last letter
    sub edi,1
    shr ecx,1                             ; = /2 only half the letters to xchg

    _loop:
    mov bl,[edi]                          ;save last letter to change
    mov bh,[esi]                          ;save first letter to change
    mov [edi],bh                          ;change letters
    mov [esi],bl                          ;as usual
    add esi,1                             ;adress second letter...
    sub edi,1                             ;adress penultimate letter...

    sub ecx,1                             ;half the string reached?
    jnz _loop                             ;no, then loop again

    ret

#ce



;make a 100MB string
$string = ""
For $i = 1 To 21                          ;pump it up...
    $string &= $string & ")*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Next
$stringlen = StringLen($string);len
ConsoleWrite('$stringlen = ' & $stringlen & " Bytes" & @CRLF & @CRLF) ;### Debug Console

;put string into memory, so we can get a pointer
$stringstruct = DllStructCreate("char[" & $stringlen & "]")
$stringptr = DllStructGetPtr($stringstruct)
DllStructSetData($stringstruct, 1, $string) ;string into memory

;lets have a look, how fast the code is (assembling is only 2-3ms)
$t = TimerInit()
$ret = _AssembleIt2("none", "_StringReverse2", "ptr", $stringptr, "uint", $stringlen)
$m = TimerDiff($t)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : time _StringReverse = ' & $m & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console


$stringreverse = DllStructGetData($stringstruct, 1)
ConsoleWrite("First 50 characters of " & Int($stringlen / 1e6) & "MB string and reversestring" & @CRLF & StringLeft($string, 50) & @CRLF & StringLeft($stringreverse, 50) & @CRLF & @CRLF)

AssembleIt2_64.zip

Edited by AndyG
Link to comment
Share on other sites

Hello. Very fast @AndyG I did my own rutine. (is not so fast) but it work good.

I was thinking I create one a little faster than this but I have a lot of time without touch this kind of stuff. 

I think is possible to do some a little faster than you without using SSE/SIMD. maybe using bswap to reduce loops. (I don't have time for check.)

 

Well. this is my small rutine.

#AutoIt3Wrapper_UseX64=n
#include "assembleit2_64.au3" ;AssembleIt assembler with debugger and much more features at autoit.de


#cs _StringReverse2
    use32                                 ;32 bit

    push ebp                                      ;save stack
    mov ebp,esp                                   ;save stack
    mov ecx,[ebp+16]                              ;set ecx String
    mov ebx,[ebp+12]                              ;set ebx Buffer
    mov edx,[ebp+8]                               ;set edx Base String
    xor edi,edi                                   ;clear edi
    _loop:                                        ;label
    mov al,byte[edx+ecx-1]                        ;get char
    mov byte[ebx+edi],al                          ;copy to new buffer
    inc edi                                       ;increment edi
    dec ecx                                       ;decrement ecx
    cmp ecx,0                                     ;compare
    jnz _loop                                     ;jump if !=0
    mov esp, ebp                                  ;release stack
    pop ebp                                       ;release stack
    ret                                           ;bye ret

#ce


;makea 100M Bstring
Local $sString = ""
For $i = 1 To 21
    $sString &= $sString & ")*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Next

$iStringLen = StringLen($sString);len
ConsoleWrite('$iStringLen= ' & $iStringLen & " Bytes" & @CRLF & @CRLF);###DebugConsole


Local $tStringBase = DllStructCreate("char[" & $iStringLen & "]")
Local $pStringBase = DllStructGetPtr($tStringBase)
DllStructSetData($tStringBase, 1, $sString)
Local $tOutString = DllStructCreate("char[" & $iStringLen & "]")

Local $hTimer = TimerInit()
Local $aRet = _AssembleIt2("none", "_StringReverse2", "ptr", $pStringBase, "ptr", DllStructGetPtr($tOutString), "uint", $iStringLen)
Local $iDiff = TimerDiff($hTimer)

ConsoleWrite("!Elapsed Time: " & $iDiff & @CRLF)

Local $sStringReverse = DllStructGetData($tOutString, 1)
ConsoleWrite("First 50 characters of: " & Int($iStringLen / 1e6) & "MB string and reverse string" & @CRLF)
ConsoleWrite(StringLeft($sString, 50) & @CRLF)
ConsoleWrite(StringLeft($sStringReverse, 50) & @CRLF)

Saludos

 

 

Link to comment
Share on other sites

@Danyfirex, very nice:thumbsup:

Challenge opened?:lmao:

I prefer to measure the clockticks of the running code, so it is possible to optimize with "little steps".

Last weekend i tried the SSE-version, unfortunately my (AMD)Processor doesn´t supports the "pshufb"-command, which is SSSE3 (yes, 3 times "S"). With the "older" SSE2/3 commands, it took a bunch of lines to shuffle the 16 bytes...grmblfxx...but in the end, the code was faster than before. 

Btw. "pshufb" is able to shuffle 16 bytes. With a corresponding mask, 16 bytes in 1 clocktick are reversed...

Same as "bswap" (swap 4 byte in a 32bit-register, you mentioned it), shown here... much faster than before. 

#AutoIt3Wrapper_UseX64=n
#include "assembleit2_64.au3"                      ;AssembleIt assembler with debugger and much more features at autoit.de

#cs _StringReverse2
    use32                                          ;32 bit

    mov ecx,[esp+12]                               ;set ecx Stringlen+padding
    mov edi,[esp+8]                                ;set ebx Buffer = destination
    mov ebx,[esp+4]                                ;set edx Base String = source

    rdtsc                                          ;ReaDTimeStampCounter, measure clockticks
    push eax                                       ;edx:eax=timerinit()

    sub ebx,4                                      ;get the last 4 chars first
    align 16                                       ;code aligning makes loop 10% faster
    _loop:                                         ;label

    mov eax,[ebx+ecx]                              ;get 4 chars ABCD
    bswap eax                                      ;thats what we want to do...
    mov [edi], eax                                 ;write 4 chars DCBA
    add edi,4                                      ;this is stosd btw...
    sub ecx,4                                      ;last 4 chars

    ja _loop                                       ;jump if >0

    rdtsc                                          ;clockticks in eax
    pop ebx                                        ;get clockticks saved before
    sub eax,ebx                                    ;timerdiff()

    ret                                            ;bye ret

#ce



;makea 100M Bstring
Local $sString = ""
For $i = 1 To 21
    $sString &= $sString & ")*+,-./0123456789:     ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Next

Local $iStringLen = StringLen($sString)            ;len
ConsoleWrite('$iStringLen= ' & $iStringLen & " Bytes" & @CRLF & @CRLF) ;###DebugConsole

Local $padding = 4 - Mod($iStringLen, 4)           ;Register = 4 bytes
If $padding = 4 Then $padding = 0


Local $tStringBase = DllStructCreate("char[" & $iStringLen & "]")
Local $pStringBase = DllStructGetPtr($tStringBase)
DllStructSetData($tStringBase, 1, $sString)
Local $padding_struct = DllStructCreate("char[" & $iStringLen + $padding & "]")
$Outstring_ptr = DllStructGetPtr($padding_struct) + $padding
Local $tOutString = DllStructCreate("char[" & $iStringLen & "]", $Outstring_ptr)


Local $t = TimerInit()
Local $aRet = _AssembleIt2("uint", "_StringReverse2", "ptr", $pStringBase, "ptr", DllStructGetPtr($padding_struct), "uint", $iStringLen + $padding)
Local $iDiff = TimerDiff($t)


ConsoleWrite("!Elapsed Time   : " & $iDiff & @CRLF)
ConsoleWrite("!Clockticks     : " & $aRet & @CRLF)
ConsoleWrite("!Clockticks/Byte: " & Int($aRet / $iStringLen * 100) / 100 & @CRLF & @CRLF)


Local $sStringReverse = DllStructGetData($tOutString, 1)

ConsoleWrite("First 50 characters of: " & Int($iStringLen / 1e6) & "MB string and reverse string" & @CRLF)
ConsoleWrite(StringLeft($sString, 50) & @CRLF)
ConsoleWrite(StringLeft($sStringReverse, 50) & @CRLF)
ConsoleWrite("!$sStringReverse checked by AutoIt: " & ($sStringReverse = StringReverse($sString, 1)) & @CRLF & @CRLF)

 

Link to comment
Share on other sites

Hello @AndyG this new rutine in my machine is slower than before, even the one mine. about 20 times slower than your old rutine. I have a  Intel Processor.

Saludos

 

 

Link to comment
Share on other sites

7 hours ago, Danyfirex said:

 

Hello @AndyG this new rutine in my machine is slower than before, even the one mine. about 20 times slower than your old rutine. I have a  Intel Processor.

 

No, the code is faster, but AssembleIt2 is slower...but only with this AutoIt-sourcecode! 

I detected a "bug"(!?) in AssembleIt2 yesterday with this code. It costs me some hours to find out how. 

One of my used RegEx-pattern to eliminate the comments out of the code runs in a socalled "catastrophic backtracking". If you write a semicolon ; at the end of the AutoIt-Script, the "catastrophic backtracking" of the RegEx will be prevented!

 

This is one of the reasons to measure the clockticks within the asm-code...

 

Link to comment
Share on other sites

  • 3 years later...

I don't know how I missed this thread until now, here are some good stuffs. I will try these snippets soon but at first glance functions using MMX might not work well since I saw that pixel processing is done in loops like below

_loop1:
...
sub ecx, 4
ja _loop1

I have a guess that this might not be enough for bitmaps where number of pixels modulo 4 is not zero.

When the words fail... music speaks.

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

×
×
  • Create New...