Search found 555 matches

by cas
Wed Jul 28, 2021 5:50 pm
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 3 released !

https://gcc.gnu.org/onlinedocs/gcc/Opti ... tions.html
Looks like purebasic passes -O2 parameter to gcc when you enable optimizations (i see -O0 and -O2 strings inside pbcompilerc.exe).
by cas
Wed Jul 28, 2021 2:13 pm
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 3 released !

Optimization is not for source code but for a compiled binary file. It is just a gcc flag (/Ox). PureBasic just translates pb code to c code and then gcc does optimizations.
by cas
Fri Jun 11, 2021 8:56 pm
Forum: Coding Questions
Topic: Why does response to Select Case repeat 2 - 3 times?
Replies: 6
Views: 1110

Re: Why does response to Select Case repeat 2 - 3 times?

Replace #PB_EventType_LeftClick with #PB_EventType_Change
by cas
Wed Jun 02, 2021 6:58 pm
Forum: Feature Requests and Wishlists
Topic: Please new constant: "#PB_Declare"
Replies: 5
Views: 2546

Re: Please new constant: "#PB_Declare"

The simplest solution i can think of is with a constants. ; ============ Declarations CompilerIf Not Defined (_BoutonDessin_declared, #PB_Constant) Debug "The declaration has not been made, I declare it!" Declare BoutonDessin() #_BoutonDessin_declared = 1 CompilerElse Debug "The decla...
by cas
Fri May 28, 2021 11:52 am
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 1 released !

Code: Select all

CompilerIf #PB_Compiler_Processor=#PB_Processor_C
  Debug "c backend"
CompilerElse
  Debug "fasm backend"
CompilerEndIf
by cas
Mon May 24, 2021 9:17 pm
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 1 released !

Now, let do the same with Rust and you're in pole position. There is no point in doing that because you can only get unsafe rust code. But, if you really want that, you can do it already. Get c code with /commented flag and then run it through c to rust transpiler (for example https://c2rust.com/).
by cas
Sun May 23, 2021 1:48 am
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 1 released !

Cezary wrote: Sat May 22, 2021 10:25 pm What it means?
This bug was already reported. Temporary fix until new update is to disable OnError lines support.
https://www.purebasic.fr/english/viewto ... 43&t=77317
by cas
Sat May 22, 2021 6:13 am
Forum: Announcement
Topic: PureBasic 6.00 released !
Replies: 626
Views: 149807

Re: PureBasic 6.00 Alpha 1 released !

but I have noticed the C compiled programs are about 30% bigger. I have not noticed that. Maybe you are using some libs (UseSQLiteDatabase(),UsePNGImageEncoder(),...) in your apps that are now updated with a new PB version. Or you are maybe comparing 64bit exe with a previous 32 bit exe. Also make ...
by cas
Sat May 22, 2021 5:48 am
Forum: The PureBasic Editor
Topic: Can't select pbcompilerc - Add button does not work
Replies: 2
Views: 4909

Re: Can't select pbcompilerc - Add button does not work

You must first enter a path (click on "..." button below).
by cas
Wed May 19, 2021 8:54 pm
Forum: General Discussion
Topic: PureBasic speed test compared to this video
Replies: 22
Views: 7832

Re: PureBasic speed test compared to this video

I finally figured out why i get that huge difference. I made a mistake and was compiling with PB 5.72 and not PB 5.73. It looks like there was a problem in PB 5.72 compiler (and maybe in older versions) . Here are new results (average from 5 runs): 5.72 x64: threadsafe enabled: 2072 threadsafe disab...
by cas
Sat May 08, 2021 10:36 am
Forum: Coding Questions
Topic: Strange speed up with unused variables
Replies: 22
Views: 2616

Re: Strange speed up with unused variables

I was talking about this code snippet from other thread:
cas wrote: Fri May 07, 2021 3:07 pm viewtopic.php?p=567877#p567877
by cas
Fri May 07, 2021 10:07 pm
Forum: Coding Questions
Topic: Strange speed up with unused variables
Replies: 22
Views: 2616

Re: Strange speed up with unused variables

Thanks for testing. It looks like i am the only one with a huge difference for that code snippet.
by cas
Fri May 07, 2021 6:00 pm
Forum: Coding Questions
Topic: Strange speed up with unused variables
Replies: 22
Views: 2616

Re: Strange speed up with unused variables

Saki wrote: Fri May 07, 2021 3:44 pm Hi cas

Without Thread save 5014 / 42.855
With Thread save 5029 / 62.086
Can you run it without debugger (compiler -> compile without debugger) and post number of passes you get for each case? Thanks
by cas
Fri May 07, 2021 3:07 pm
Forum: Coding Questions
Topic: Strange speed up with unused variables
Replies: 22
Views: 2616

Re: Strange speed up with unused variables

My results with PBx64 with 10 runs: with vars: 1222-1263 vars commented out: 1245-1290 Barely any difference (~2%) compared to yours (~25% difference). Can you also test this code: https://www.purebasic.fr/english/viewtopic.php?p=567877#p567877 ? I have 30% speed difference on my system with that co...
by cas
Fri Apr 30, 2021 2:28 am
Forum: Announcement
Topic: Blog post !
Replies: 325
Views: 92722

Re: Blog post !

Trust me, K&R is horrible when the code gets large and inline comments and multiple developers. Allman solves all that noise. Clang-Format solves all that noise. Each company has its own style guidelines and each developer can just write code in their own personal style of choice but before com...