BBCode Link
[url=http://www.purearea.net/pb/showcase/show.php?id=156&d=1] [b]Optimizer v.1.5[/b][/url]
Not for PB4.0 -> project abandoned!
http://forums.purebasic.com/german/viewtopic.php?t=2108
Features List:
# Macros!
- Needs user library
- Some restrictions: no local vars, needs at least one parameter
# Userlibrary
- OptimizerPause() and OptimizerResume()
- Calculating with doubles (64bit-Floats)
- All the functions will be inlined by the optimizer (like macros)
# Cuts out unused procedures
- If a procedure was created but never used in any way like @procedure() or procedure(), it wont be compiled into the executable.
# Inlining of procedures:
- PeekF(), PokeF(), PeekL(), PokeL(), PeekW(), PokeW(), PeekB(), PokeB()
- CallFunctionFast()
- Red(), Green(), Blue(), RGB()
- ACos(), ASin(), ATan(), Int(), Log(), Log10()
# Multiplication with constants
i.c. a * 151, a * 1025, etc.
# Asm-Optimizations
- a = b - -a
- a % 2, a % 4, ... a % 2^n
become a&1, a&3, ... a&(2^n-1)
- and some smaller ones
What does it do:
It optimizes the ASM output of PB. To do so, it uses some asm tricks and simple shortages.
Manual:
1. Download zip and extract it
2. Copy FAsm2.exe, FAsm.exe, IMULOptimierungen.txt and Optimizer.ini in the directory "PBCompilers" (you can replace FAsm.exe or rename the old one in FAsm2.exe )
3. Compile something
4. A window "Optimizer" appears
- Hide this window next time (do not show this window again)
- Optimize PureBasic.asm (optimize the current compilation?)
5. Done!
(you can adjust this settings in the Optimizer.ini)
How does this program work:
The new FAsm.exe represents the optimizer. The PB compiler calls it with the FAsm parameters. Now, it optimizes the PureBasic.asm and then calls the real FAsm (FAsm2.exe).
Results (for an unrealistic, good example (you can find it in the German forums)):
without Opt.: 5078ms (PB) versus 2453ms (Asm)
with Opt.: 2542ms versus 2532
|
|
[170 KB] (1251 Downloads)
The source is included in the program package
|