Re: speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Folkert,

cobc is calling gcc.
Just do cobc -v ... and you will see the exact calls.
I think the difference is that you are using -O3 instead of -O2 and 
arch/tunes.
You can pass options to gcc from cobc command line, as well as define 
your options using environment variables.
Just do your own research :-)

Regards,
SK

On 5/19/2016 6:09 PM, folkert wrote:
> Hi,
>
> While experimenting with my brainfuck-to-cobol translator (
> http://tinyurl.com/bftocob ) I noticed that if I do not let cobc
> directly output a binary (on linux) but go through the gnu-c compiler
> instead, that I get a 16,8% speed improvement (tested with a mandelbrot
> fractal).
> Is this to be expected?
>
> compiled and linked by cobc (cobc -O2)
> --------------------------------------
> real    11m19.063s
> user    11m15.768s
> sys     0m1.084s
>
> translated to c and then compiled with gnu-c
> --------------------------------------------
> real    9m25.608s
> user    9m24.040s
> sys     0m0.492s
>
> What I did:
> cobc -O2 -fimplicit-init -C mandelbrot.cbl
> gcc -O3 -march=native -mtune=native -fomit-frame-pointer -lcob mandelbrot.c -o mb2
>
>
> Also: how does cobc create the binary, does it run gnu-c underneath? Or
> does it compile to binary by itself?
>
>
> Folkert van Heusden
>


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
open-cobol-list mailing list
open-cobol-list@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/open-cobol-list



[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux