
For more infos just follow this thread ot take a look to the german forum: http://forums.purebasic.com/german/view ... 6423#56423

Download at: http://www.deeem2031.de/PB/D_Optimizer.zip
Update v1.14
-You can also set "Optimize_CMPNullString" to 0 if you dont want to download the new version
Features of v1.13:
(for procedures)
- delete unnecessary push/pops of procedure calls
- the ClearLoop will be replaced by a faster routinet
- Ecx will be deleted everytime from stack
- When possible, Esi will be replaced by using Esp
- when having a ProcedureReturn at the end of a procedure, undo (putting back) of the result will be deleted
(others)
- For-Next Loops will be multiplies if possible (the code will go larger, however it runs a little bit faster)
- replacing of SYS_StringEqual with null strings by direct processing
Installations-Guide:
- without remis Optimizer:
-> rename "...\Purebasic\Compilers\Fasm.exe" to "Fasm2.exe"
-> Unpack the zip content to "...\Purebasic\Compilers\"-folder
-> be happy

- with remis Optimizer:
-> rename "...\Purebasic\Compilers\Fasm.exe" to "Remis_Optimierer.exe" (you can use any other name for the exe too)
-> Unpack the zip content to "...\Purebasic\Compilers\"-folder
-> Open "D_Optimierer.ini" and change "FasmExe" to "Remis_Optimierer.exe" -> "FasmExe = Remis_Optimierer.exe"
-> be happy

Example:
Code: Select all
Procedure a(x)
Protected a,b,c
a = x
ProcedureReturn a
EndProcedure
#r = 40000000
s.s = ":)"
st1 = GetTickCount_()
For i = 1 To #r
If s
a(2)
EndIf
Next
t1 = GetTickCount_()-st1
MessageRequester("",Str(t1))
- no optimizing: 1172 ms
- with optimizing: 438ms
; --------------------------------------------------
New in jaPBo v1.13 - 09-November-2005
hopefully the last bug of the beta version has been fixed, so you will get v1.13 now

; --------
New in jaPBo v1.12 - 13-October-2005 - 23:38
Nothing worldmoving new! Deeem2031 has only changed the statistics and optimisations for size of the source/sources/exe a bit! Just give it a try

NTQ from the german forum was so friendly and compared the speed difference of his raytracer engine: From slow 60 seconds it was optimized up to fast 51 seconds (


- eliminate double string-ends (optimize the size / doesnt affect on speed)
- some other little thinks
; --------
New in jaPBo v1.11 - 08-October-2005 - 17:50
Deeem2031 still found a way to implent his old optimisations again! Callsbacks and such things will be ignored.
; --------
New in jaPBo v1.10 - 08-October-2005 - 13:15
Due fact of some internaly purebasic coding reasons, you get a fixed/compatible v1.10 (but its no longer so fast as before)
; --------
New in jaPBo v1.07 - 08-October-2005 - 00:05
- bugfix of deleting the unnecesary register pushs
- when having a ProcedureReturn at the end of a procedure, undo (putting back) of the result will be deleted
; --------
New in jaPBo v1.06 - 07-October-2005
- replacing of SYS_StringEqual with null strings by direct processing
i.e. all comparisons of strings with a null string, like "If string.s" will run faster. (' If string.s < > "" ' will not be improved)
Example:
Code: Select all
Procedure a(x)
Protected a,b,c
a = x
EndProcedure
#r = 40000000
s.s = ""
st1 = ElapsedMilliseconds()
For i = 1 To #r
a(2)
If s
EndIf
Next
t1 = ElapsedMilliseconds()-st1
MessageRequester("",Str(t1))
no optimizing: ca. 375 ms
; --------
New in jaPBo v1.05 - 07-October-2005 - 00:55
- Nothing, it's just a bug-fix release

; --------
New in jaPBo v1.04 - 03-October-2005 - 11:55
- LogFiles can now be overwritten
- Log-Output has been a bit improved
- For-Next Loops will be multiplies if possible (the code will go larger, however it runs a little bit faster)
So i have saved once again 30 ms -> 170 ms
; --------
New in jaPBo v1.03 - 03-October-2005 - 01:00
- starting the exe will display a few infos
- Ecx will always deleted from stack
- Esi will be replaced by Esp if possible
- so the example is once again about 30 ms faster! -> ca 200 ms
So i am at the end with procedure optimisations, anyway i dont noticed anything more to optimize the procedures... but i saw something... later..
For those, who are to lazy to take a look but wanted to know what has been optimized:
Original:
Code: Select all
_Procedure0:
PUSH ebx
PUSH ecx
PUSH ebp
PUSH esi
PUSH edi
MOV esi,esp
SUB esp,16
MOV eax,esp
MOV edx,eax
ADD edx,16
_ClearLoop0:
MOV dword [eax],0
ADD eax,4
CMP eax,edx
JNE _ClearLoop0
MOV eax, dword [esi+24]
MOV dword [esp+0],eax
; Protected a,b,c
; a = x
MOV eax,dword [esp]
MOV dword [esp+4],eax
; EndProcedure
XOR eax,eax
_EndProcedure1:
ADD esp,16
POP edi
POP esi
POP ebp
POP ecx
POP ebx
RET 4
_EndProcedure0:
Code: Select all
_Procedure0:
PUSH 0
PUSH 0
PUSH 0
PUSH 0
mov eax, dword [Esp-20+16+24]
MOV dword [esp+0],eax
MOV eax,dword [esp]
MOV dword [esp+4],eax
XOR eax,eax
_EndProcedure1:
ADD esp,16
RET 4
_EndProcedure0:

; --------
New in jaPBo v1.02 - 02-October-2005 - 22:45
- example runs now 20ms faster!
The "possibility to delete the ClearLoop of procedures. (it set all protected vars back to 0... mostly unnecessarily )" does not happen, because PB strings strongly require to set back setting. It would only work if sont use use strings in procedures - but therfor the loop will be relaced. So the example will from the first posting will speed up from 500 to 234 ms, smile.
PLEASE NOTE: please dont change "Optimize_ReplaceEsi = 0" in the ini file!!!
; --------
New in jaPBo v1.01 - 02-October-2005
- ASM-ErrorMessages will displayed correctly now (thx to remi_meier)
- ClearLoop will be replaced by a faster routine
; --------
New in jaPBo v1.00 - 02-October-2005
- removes unused Push/Pops of procedure calls