Page 2 of 4
Re: [IDE Tool] pbOptimizer
Posted: Fri Aug 16, 2019 8:02 pm
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.
Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 6:06 am
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)
with your pb file, the PB word Procedure is truncated

Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 6:49 am
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
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

Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 2:11 pm
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!
Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 3:23 pm
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.
Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 4:43 pm
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.
Re: [IDE Tool] pbOptimizer
Posted: Sat Aug 17, 2019 9:52 pm
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 ^^
Re: [IDE Tool] pbOptimizer
Posted: Wed Aug 21, 2019 9:53 pm
by chi
updated to v0.9.8.4
Re: [IDE Tool] pbOptimizer
Posted: Thu Aug 22, 2019 5:35 am
by Denis
chi,
it's seems to be Ok now.
Tks
Re: [IDE Tool] pbOptimizer
Posted: Thu Aug 22, 2019 12:11 pm
by chi
updated to v0.9.8.5
Denis wrote:chi,
it's seems to be Ok now.
Tks
Glad to hear that

. I fixed a lot of other stuff with the help of your project... Much appreciated!
Re: [IDE Tool] pbOptimizer
Posted: Sun Sep 01, 2019 1:38 am
by chi
updated to v0.9.8.6
Re: [IDE Tool] pbOptimizer
Posted: Tue Jul 14, 2020 9:22 pm
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
Re: [IDE Tool] pbOptimizer
Posted: Wed Jul 15, 2020 12:39 am
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?
Re: [IDE Tool] pbOptimizer
Posted: Wed Jul 15, 2020 7:00 am
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
Re: [IDE Tool] pbOptimizer
Posted: Wed Jul 15, 2020 7:23 am
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.