With pbOptimizer you can clean up your source code and/or final executable from leftover Comments, Procedures, uncalled PB Libraries and Functions.
This is a beta version! Please report all bugs here... Thank you. Download pbOptimizer.zip (PB 5.7x+, Windows only)
v0.9.8.10
disabled "Create .pb" temporarily, as it's error prone (e.g. IncludePath bug) and pretty much useless in its current state. PB removes Macros\Procs (to a degree) internally once the .ASM is created
added the ability to use "Editor Constants", "Custom Constants", "Version Info Token" and "Version Info Fields Values" (like #PB_Editor_FileVersionNumeric)
v0.9.8.9
fixed compiling with "Create .pb" disabled
fixed "Remove Absolute Paths" to be more aggressive (IncludeBinary, IncludePath)
fixed linker.config was not applied when creating the ASM file (PB automatically creates a binary file as the .ASM is written)
v0.9.8.8
fixed writing the .rc file to disk (Thanks to loulou2522)
fixed "Create .asm" checkbox now also toggles "Remove Multiple Spaces"
v0.9.8.7
added "Linker options file" support (must be called linker.config)
added "Remove Multiple Spaces" for ASM files
fixed CompilerIf warnings for PREPROCESS pass
added "Exit" button (after compilation is done)
open issues: Tokens in Version Info, Generate License.txt
v0.9.8.6
fixed ImageEncoder removal
added the display of "Called WinAPI Functions" when processing ASM
v0.9.8.5
fixed "Remove Uncalled Libs/Funcs" not working properly without having "Remove Comments" selected too
fixed ImagePlugins detection
added Jpeg2000 support (.jp2)
added a MessageBox if the compiled program crashes on execution ("Run Output")
renamed "Remove Macro Comments" to "Remove Resolved Macros"
some minor fixes
v0.9.8.4
fixed a bug with RC files that weren't added when "Include Version Information" was not ticked (Many thanks to Denis for providing me with a project)
added a hint for "Open .pb". If you open the same file again and again, you first have to close the file in the IDE or you won't see the update...
v0.9.8.3
#PB_Editor_CompileCount, #PB_Editor_BuildCount, #PB_Editor_CreateExecutable are no longer case sensitive
IDE file settings are now also applied to the optimized .pb
tweaked Macros and Procedures filtering
some minor fixes
v0.9.8.2
added compatibility with #PB_Editor_CompileCount, #PB_Editor_BuildCount, #PB_Editor_CreateExecutable (read only)
added "Remove ImagePlugins" to remove ImagePlugins if the string ".bmp", ".png", ".tga", ... was not found anywhere in the source code
added a timer
more string concatenations fixed
"Remove Uncalled Procedures" is not case sensitive anymore
I also tried it out with a bigger project, there the optimization runs already since 20min...
Could you still display interim reports or a progress bar to see if the program is still running?
Ciao Dige
"Daddy, I'll run faster, then it is not so far..."
dige wrote:The tested source code has about 100000 lines.
I aborted pbOptimizer after 30min.
The same result with version 0.9.8.1.
Ciao Dige
Hard to say... The biggest project I'm testing with is ~12.000 ASM lines and it takes about 20 seconds (0.9.8.1) to compile. With 0.9.8.0 it took 2min. Maybe it's another string problem, but without testing/debugging, it's just a hunch.
BarryG wrote:Using 0.9.8.1 beta, my source is stuck on this for over 5 minutes now:
Always stuck after "String Format"? Was it able to finish? What OS are you on (x86,x64)?
Denis wrote:Hi chi
i don't know how fred do with PB lib.
So, if you remove a call to a PB lib named 'x', and PB use it not directly but inside another lib, how to know that ?
Just a question.
You can see the dependencies when you edit e.g.\PureBasic\PureLibraries\Window = 2DDrawing Desktop VectorDrawing SimpleList Object Gadget Event. pbOptimizer simply filters them and deletes those that are never called.
So, if you remove a call to a PB lib named 'x', and PB use it not directly but inside another lib, how to know that ?
Just a question.
You can see the dependencies when you edit e.g.\PureBasic\PureLibraries\Window = 2DDrawing Desktop VectorDrawing SimpleList Object Gadget Event. pbOptimizer simply filters them and deletes those that are never called.
What i want to tell is that there are may be hidden reference to this lib that is a lib coulb be called indirectly by another lib not only par it's ows procedures.
chi wrote:
Does anyone know a big project to test with?
I will try with my projet PureIconManager (about 65 000 lines) but today if i get enough time.
Gave it a try but it doesn't like Editor Constants...
Maybe it would be a good idea to display an error message and quit instead of listing an error with all the other info in the optimizer window and showing "Optimizing..."
I didn't realize the optimizer was done because it still showed "Optimizing..."
It also removed procedures that were actually being used so the final optimized code would not compile.