gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] speed


From: Sergey Kashyrin
Subject: Re: [open-cobol-list] speed
Date: Thu, 19 May 2016 19:47:35 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]