[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

Re: [IDE Tool] pbOptimizer

Post by chi »

Cyllceaux wrote:

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.
Will be fixed in the next beta... Please us CamelCase #PB_Editor_CompileCount, #PB_Editor_BuildCount and #PB_Editor_CreateExecutable until then.
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 »

Hi Chi,

with the projet i'm on :

Module, OOP coding, test wity 64 bits compiler PB 5.70 LTS
My example compile without probleme

With your optimizer, it generate an erreur (same error in 32 or 64 bit compilation)

Image


with your pb file, the PB word Procedure is truncated
Image
A+
Denis
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: [IDE Tool] pbOptimizer

Post by Denis »

Chi,

with my Projet PureIconManager (original asm file has 229404 lines)

it takes 71,5 s to optimize

Final exe file size : 1281 Kb
original exe size : 1740 Kb

The exe compile but it's not Ok, it display only this and nothing more

Image


Image

I use 3 ressource files to compile (.rc file) , version informations and constant #PB_Editor_CompileCount
I don't know if i had to add this files somewhere or not
Image
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 »

Denis wrote:Hi Chi,

with the projet i'm on :

Module, OOP coding, test wity 64 bits compiler PB 5.70 LTS
My example compile without probleme

With your optimizer, it generate an erreur (same error in 32 or 64 bit compilation)

with your pb file, the PB word Procedure is truncated
Could you please turn off "Remove Uncalled Procedures" from the settings window and try compiling again? This is just a 'cosmetic' feature anyways, since PB will strip unused Procedures on its own. Only needed if you want to edit the .pb file before converting it to .asm
Any chance you could isolate the problem part (around GetMaximizeButtonPatternColorsStateExpanded() and GetMinimizeButtonPatternColors()) and send me a snippet to test? Or are there any hidden characters after the previous procedure? Something unusual?
Denis wrote:Chi,

with my Projet PureIconManager (original asm file has 229404 lines)

it takes 71,5 s to optimize

Final exe file size : 1281 Kb
original exe size : 1740 Kb

The exe compile but it's not Ok, it display only this and nothing more

I use 3 ressource files to compile (.rc file) , version informations and constant #PB_Editor_CompileCount
I don't know if i had to add this files somewhere or not
It should be fine without any addition. Could you please uncheck the version info, compile (IDE) and run? Then remove the 3 .rc files line by line and test again. So we could narrow it down a little bit...

Also nice to see, ~230.000 lines in 72 seconds ^^

...and Thanks for testing!
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:Or are there any hidden characters after the previous procedure? Something unusual?
I use extra characters in the module (alt 255 and so one, i will take a deeper look to my code and remove them and try again).

About PureIconManager, i will try with your recommandation and try again.
A+
Denis
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: [IDE Tool] pbOptimizer

Post by Denis »

For the first, i've turned off "Remove Uncalled Procedures" and now no problem , a little project, no optimization at all.

With PureIconManager, i will try again.
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 »

updated to v0.9.8.3

Denis wrote:For the first, i've turned off "Remove Uncalled Procedures" and now no problem , a little project, no optimization at all.

With PureIconManager, i will try again.
Try the new beta, hope it's fixed now ^^
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.4
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,

it's seems to be Ok now.

Tks
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 »

updated to v0.9.8.5

Denis wrote:chi,
it's seems to be Ok now.
Tks
Glad to hear that :wink:. I fixed a lot of other stuff with the help of your project... Much appreciated!
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.6
Et cetera is my worst enemy
camille
User
User
Posts: 66
Joined: Tue Nov 19, 2019 12:52 pm

Re: [IDE Tool] pbOptimizer

Post by camille »

Code: Select all

 ---  ASM  -------------------------------------------------------------------------------------------------------------------------

	
	******************************************
	PureBasic 5.72 (Windows - x64)
	******************************************
	
	Compiling D:\Users\Highend\Development\PureBasic\Large text file creator\Large text file creator_pbOpt.pb
	Loading external libraries...
	Starting compilation...
	Error: Line 3 - Constant already declared with a different value: #PB_Compiler_IsIncludeFile.


	Optimizing...


	Time: 0.2s
Part of the source code:

Code: Select all

EnableExplicit
#PB_Compiler_IsMainFile = #True
#PB_Compiler_IsIncludeFile = #True
DeclareModule Consts
#SQ = Chr(39)
#DQ = #DOUBLEQUOTE$
#DCRLF = #CRLF$ + #CRLF$
#EOL = #CRLF$
#OS_Sep = "\"
#HWND_MESSAGE = -3
Enumeration ExitCodes 0 Step -1
#Ok
#Error_Undefined
#Error_Already_Running
#Error_AutoElevation
#Error_InsufficientArgs
EndEnumeration
EndDeclareModule
Module Consts
EndModule
UseModule Consts
#PB_Compiler_IsIncludeFile = #True
DeclareModule Structs
Structure _OWN
...
Each include module has this statement that pbOptimizer doesn't like.
All of these entries are set to #True
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 »

camille wrote: Part of the source code:

Code: Select all

EnableExplicit
#PB_Compiler_IsMainFile = #True
#PB_Compiler_IsIncludeFile = #True
DeclareModule Consts
#SQ = Chr(39)
#DQ = #DOUBLEQUOTE$
#DCRLF = #CRLF$ + #CRLF$
#EOL = #CRLF$
#OS_Sep = "\"
#HWND_MESSAGE = -3
Enumeration ExitCodes 0 Step -1
#Ok
#Error_Undefined
#Error_Already_Running
#Error_AutoElevation
#Error_InsufficientArgs
EndEnumeration
EndDeclareModule
Module Consts
EndModule
UseModule Consts
#PB_Compiler_IsIncludeFile = #True
DeclareModule Structs
Structure _OWN
...
[/size]What?
Et cetera is my worst enemy
camille
User
User
Posts: 66
Joined: Tue Nov 19, 2019 12:52 pm

Re: [IDE Tool] pbOptimizer

Post by camille »

That's the beginning of the "Large text file creator_pbOpt.pb" file.

With line 3 "#PB_Compiler_IsIncludeFile = #True" which pbOptimizer is complaining about
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: [IDE Tool] pbOptimizer

Post by firace »

camille wrote:That's the beginning of the "Large text file creator_pbOpt.pb" file.

With line 3 "#PB_Compiler_IsIncludeFile = #True" which pbOptimizer is complaining about
#PB_Compiler_IsIncludeFile is a built-in, reserved constant - I don't think that explicitly modifying its value is supported.
Post Reply