PureBasic Forum
http://forums.purebasic.com/english/

[IDE Tool] pbOptimizer
http://forums.purebasic.com/english/viewtopic.php?f=27&t=73385
Page 1 of 3

Author:  chi [ Tue Aug 13, 2019 6:43 pm ]
Post subject:  [IDE Tool] pbOptimizer

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.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

Author:  skywalk [ Wed Aug 14, 2019 5:53 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

Can't wait to try! 8)

Author:  dige [ Wed Aug 14, 2019 9:10 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

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

Author:  chi [ Wed Aug 14, 2019 12:56 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

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 ;)

Author:  chi [ Wed Aug 14, 2019 3:55 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

updated to v0.9.8.1

Author:  dige [ Thu Aug 15, 2019 7:55 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

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

Ciao Dige

Author:  BarryG [ Thu Aug 15, 2019 9:19 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

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

Image

Author:  dige [ Thu Aug 15, 2019 9:26 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

After 1 hour and 30 min .. the last output is still "Optimizing..."

Author:  Denis [ Thu Aug 15, 2019 11:54 am ]
Post subject:  Re: [IDE Tool] pbOptimizer

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.

Author:  chi [ Thu Aug 15, 2019 5:19 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

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?

Author:  Denis [ Thu Aug 15, 2019 5:34 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

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.

Author:  Paul [ Thu Aug 15, 2019 8:34 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

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.

Author:  chi [ Fri Aug 16, 2019 1:08 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

updated to v0.9.8.2

Author:  chi [ Fri Aug 16, 2019 1:40 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

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 ;)

Author:  Cyllceaux [ Fri Aug 16, 2019 4:41 pm ]
Post subject:  Re: [IDE Tool] pbOptimizer

Code:
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.

Page 1 of 3 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/