[IDE Tool] pbOptimizer

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

[IDE Tool] pbOptimizer

Post by chi »

Image
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
v0.9.8.1
  • better string concatenation (massive speed improvement)
  • optimized UI responsiveness
  • added a progressbar
v0.9.8.0
  • fixed a bug with _THREAD and _DOUBLE
Last edited by chi on Mon Apr 26, 2021 4:17 pm, edited 15 times in total.
Et cetera is my worst enemy
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [IDE Tool] pbOptimizer

Post by skywalk »

Can't wait to try! 8)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
dige
Addict
Addict
Posts: 1247
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: [IDE Tool] pbOptimizer

Post by dige »

Looks promising! :)

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..."
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

dige wrote:I also tried it out with a bigger project, there the optimization runs already since 20min...
Over 20min? How many lines did the ASM-part report? Did it finish successfully, though?
dige wrote:Could you still display interim reports or a progress bar to see if the program is still running?
I'll see what I can do ;)
Et cetera is my worst enemy
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

updated to v0.9.8.1
Et cetera is my worst enemy
dige
Addict
Addict
Posts: 1247
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: [IDE Tool] pbOptimizer

Post by dige »

The tested source code has about 100000 lines.
I aborted pbOptimizer after 30min.
The same result with version 0.9.8.1.

Ciao Dige
"Daddy, I'll run faster, then it is not so far..."
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: [IDE Tool] pbOptimizer

Post by BarryG »

Using 0.9.8.1 beta, my source is stuck on this for over 5 minutes now:

Image
dige
Addict
Addict
Posts: 1247
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: [IDE Tool] pbOptimizer

Post by dige »

After 1 hour and 30 min .. the last output is still "Optimizing..."
"Daddy, I'll run faster, then it is not so far..."
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: [IDE Tool] pbOptimizer

Post by Denis »

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.
A+
Denis
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

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.


Does anyone know a big project to test with?
Et cetera is my worst enemy
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: [IDE Tool] pbOptimizer

Post by Denis »

chi wrote:
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.
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.
A+
Denis
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: [IDE Tool] pbOptimizer

Post by Paul »

Gave it a try but it doesn't like Editor Constants...
Image

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.
Image Image
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

updated to v0.9.8.2
Et cetera is my worst enemy
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

chi wrote: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.
With 0.9.8.2 it takes 8 seconds to compile ;)
Et cetera is my worst enemy
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [IDE Tool] pbOptimizer

Post by Cyllceaux »

Code: Select all

LoggerInfo("Version - 0.1."+Str(#pb_editor_buildcount)+"."+Str(#pb_editor_compilecount))
This is some lines of my code.
#pb_editor_buildcount
#pb_editor_compilecount

are PB constants when you activate it.
Post Reply