Just another Purebasic Optimizer - New release - JaPBo v1.14

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

I finished Version 1.05:

What's new? Nothing, it's just a bug-fix release. :)

edit:

Version 1.06:

-replace SYS_StringEqual call with a faster routine if possible

that means all commands like "If String.s" will run faster

e.g.:

Code: Select all

Procedure a(x) 
  Protected a,b,c 
  a = x 
EndProcedure 

#r = 40000000 

s.s = "" 

st1 = ElapsedMilliseconds() 
For i = 1 To #r 
  a(2) 
  If s 
  EndIf 
Next 
t1 = ElapsedMilliseconds()-st1 

MessageRequester("",Str(t1))
without opt: ca. 1030 ms
with opt: ca. 375 ms
irc://irc.freenode.org/#purebasic
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Deeem2031,

I think I've found a bug in your latest optimizer (v1.05). When compiling when program, I get the following error:

---------------------------
jaPBe - Assembler error
---------------------------
Opt_Purebasic.asm [1168]:
push dword _s4
error: undefined symbol.

---------------------------
OK
---------------------------

Looking through the file Opt_Purebasic.asm, I noticed that every other reference is "_S4" - with an uppercase S, not a lowercase s.
Just this one line is "_s4". Doesn't FAsm consider "_s4" and "_S4" different variables?

I found one other occurrence of this. Most of the time, the asm statement is:
PUSH dword [PB_StringBase]
but a few times it is:
PUSH dword [pb_stringbase]

Again, notice the upper- vs. lowercase issue.

I edited the Opt_Purebasic file to change all these items to uppercase, and I no longer get any errors. Can you check into this and see if this is a bug?

Thanks,
Eric
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

Yes, this is a bug but i can't locate them because I haven't got a code which produce this error. So it would be helpful, if you post a code or, if you don't want to, the log-file.
irc://irc.freenode.org/#purebasic
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Deeem2031,

The log file is over 130 KB. Can you give me an e-mail address, so I can send it to you? If it would help, I can post just the parts that show the bug.

Regards,
Eric
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

The part that shows the bug should be enouth to fix it. I only need the info in which routine the bug is. Something like "-> replace ClearLoop (Version 1.0)" before the bug appears, show this.

Btw. the email-addr mostly stand under the posts of the user. -> webmaster@deeem2031.de
irc://irc.freenode.org/#purebasic
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Deeem2031 wrote:Btw. the email-addr mostly stand under the posts of the user. -> webmaster@deeem2031.de
Of course - I should have noticed that! :oops:

Here's one section of the log file that changes "_S4" to "_s4":

Code: Select all

>Found _procedure120
-> replace ClearLoop (Version 2.0)
-> replace Esi with Esp (RemoveCheck) (Version 1.0)
--> Found Esi-Command: "push esi"
--> Found Esi-Command: "pop esi"
-> remove unused register (Version 1.1)
--> check register ebx
---> register won't be used -> remove it
Remove: " PUSH ebx" (Pos: 8704832)
Remove: " POP ebx" (Pos: 8708648)
--> check register ecx
---> register is Ecx -> remove it
Remove: " PUSH ecx" (Pos: 8704880)
Remove: " POP ecx" (Pos: 8708600)
--> check register ebp
---> register won't be used -> remove it
Remove: " PUSH ebp" (Pos: 8704928)
Remove: " POP ebp" (Pos: 8708552)
--> check register esi
---> register won't be used -> remove it
Remove: " PUSH esi" (Pos: 8704976)
Remove: " POP esi" (Pos: 8708504)
--> check register edi
---> register won't be used -> remove it
Remove: " PUSH edi                                                                                                                                                                                                                                                           " (Pos: 8705024)
Remove: " POP edi" (Pos: 8708456)
Modify: " PUSH dword _S4" -> "push dword _s4" (Pos: 8705320)
Modify: " PUSH dword 268435456" -> "push dword 268435456" (Pos: 8705368)
Modify: " PUSH dword 374" -> "push dword 374" (Pos: 8705424)
Modify: " PUSH dword 350" -> "push dword 350" (Pos: 8705472)
Modify: " PUSH dword 95" -> "push dword 95" (Pos: 8705520)
Modify: " PUSH dword 375" -> "push dword 375" (Pos: 8705568)
-> removed 5 unused register
--> modify stack
-> replace Esi with Esp (Version 1.0)
--> Modify Esi-commands
--> Remove Esi-commands
and one showing the "PB_StringBase" problem:

Code: Select all

>Found _procedure44
-> replace ClearLoop (Version 2.0)
-> replace Esi with Esp (RemoveCheck) (Version 1.0)
--> Found Esi-Command: "push esi"
--> Found Esi-Command: "pop esi"
-> remove unused register (Version 1.1)
--> check register ebx
---> register won't be used -> remove it
Remove: " PUSH ebx" (Pos: 9098792)
Remove: " POP ebx" (Pos: 9100944)
--> check register ecx
---> register is Ecx -> remove it
Remove: " PUSH ecx" (Pos: 9098840)
Remove: " POP ecx" (Pos: 9100896)
--> check register ebp
---> register won't be used -> remove it
Remove: " PUSH ebp" (Pos: 9098888)
Remove: " POP ebp" (Pos: 9100848)
--> check register esi
---> register won't be used -> remove it
Remove: " PUSH esi" (Pos: 9098936)
Remove: " POP esi" (Pos: 9100800)
--> check register edi
---> register won't be used -> remove it
Remove: " PUSH edi                                                                                                                                                                                                                                                           " (Pos: 9098984)
Remove: " POP edi" (Pos: 9100752)
Modify: " PUSH dword [PB_StringBase]" -> "push dword [pb_stringbase]" (Pos: 9099280)
-> removed 5 unused register
--> modify stack
-> replace Esi with Esp (Version 1.0)
--> Modify Esi-commands
--> Remove Esi-commands
Regards,
Eric
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

irc://irc.freenode.org/#purebasic
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Deeem2031,

Wow - that's what I call fast service!
I won't be able to try out the new version until tomorrow, but I'll let you know if it works on my program.

Thanks,
Eric
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Just another Purebasic Optimizer - New release - JaPBo v

Post by ricardo »

va!n wrote: For more infos just take a look to the german forum: http://forums.purebasic.com/german/view ... 6423#56423 :D

:?: :?:

And the people that don't understand german?????

Every day more, looks like need to learn german to participate in this forums :twisted: :cry:
ARGENTINA WORLD CHAMPION
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

JaPBo v1.07 released!

@ricardo:
quote: "And the people that don't understand german?????"

For this people we have this english thread to give Deeem2031 any bugreport, wishes, feedback ;-)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Deeem2031,

I just tried v1.10 and my program compiled without error.

Thanks,
Eric
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

va!n wrote:JaPBo v1.07 released!

@ricardo:
quote: "And the people that don't understand german?????"

For this people we have this english thread to give Deeem2031 any bugreport, wishes, feedback ;-)
Yes, but my question was because the 'more info' link was in German.

I hope you can explian more detailed about this tool in English. Thanks.
ARGENTINA WORLD CHAMPION
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@ricardo:
ahhh sorry.. now i understand ;) i just only wrote it, because interested people can take a look and follow the german thread too! But all "important" news from the german forum will posted here in english too ;)
So there should be nothing you must miss when dont take a look to the german thread.Hope this is ok for you.. ;).
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

va!n wrote:@ricardo:
ahhh sorry.. now i understand ;) i just only wrote it, because interested people can take a look and follow the german thread too! But all "important" news from the german forum will posted here in english too ;)
So there should be nothing you must miss when dont take a look to the german thread.Hope this is ok for you.. ;).
Thanks!! :)
ARGENTINA WORLD CHAMPION
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

Edit: added times for default #N = 5999999

Great utils, thanks! But something strange trying them with "Test.pb". First, I'm on an old 233MHz notebook so I have reduced the loop counter to 1,000,000. Next I run different combo's of both optimizers and here are the results ("D" for Deeem's, "M" for Meier's)...

Code: Select all

M D  #N=1000000 #N=5999999
0 0   15215  90229
0 1   14995  90105
1 0    4740   29444
1 1    4909   29325
Notice last one increases :shock: Guess it will pay to experiment or is this just an anomaly?

PS: Also getting a dos window with the latest (so not seeing any progress bar)
Post Reply