[Gambas-user] Wow, Gambas is twice as fast as (Free) Pascal

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Oct 12 02:24:05 CEST 2014


My cleaning script didn't include "rm -f /usr/local/bin/gbs3" and
apparently because of changed paths "make install" didn't overwrite old
version. So my gbs3 had version number 3.2.90, and no -f option (it was
simply ignored)!
Just to warn others, you may want to check whether you too have two
versions of gbs3 installed (in /usr/local/bin/gbs3 and in /usr/bin/gbs3).
If you do, remove the files, run "sudo make install" again and restart your
terminal.

$ time gbs3 -c -f polym.gambas
1250000
1250000
1250000
1250000
1250000
1250000
1250000
1250000
1250000
1250000

real    0m4.172s
user    0m4.158s
sys    0m0.012s


$ time ./polym
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006
 1.25000000000000E+006

real    0m5.376s
user    0m5.374s
sys    0m0.000s


So, Gambas really is faster in fair comparison!




Jussi



On Sat, Oct 11, 2014 at 10:49 PM, T Lee Davidson <t.lee.davidson at ...626...>
wrote:

> Just to be clear, I did not run 'polynom.gambas' as a script with the
> she-bang specifying to use 'gbs3' to execute it. That *is* slow.
>
> I executed it using gbs3 with the '-f' option invoking the JustInTime
> compiler.
>
> I also just now used the IDE to create a command-line application based
> on the benchmark, created an executable, and then ran that. That was
> also so slow (almost 2 minutes to Print the first result) that I did not
> let the timing test finish.
>
> So, it appears that the JIT compiler option is what makes the huge
> difference -- on my system anyway.
>
>
> On 10/11/2014 03:07 PM, T Lee Davidson wrote:
> > I guess I should have included my system information; just didn't think
> > about it being relevant at the time. Obviously, though, it is.
> >
> > System Info:
> > Intel(R) Pentium(R) 4 CPU 2.40GHz, 1G RAM
> > Mageia 3, Kernel 3.10.54 (KDE4)
> > Gambas 3.5.4
> > Free Pascal Compiler version 2.6.4 [2014/03/07] for i386
> >
> >
> > Interestingly, closing my web browser gave me better performance with
> > both, but still a roughly 2:1 difference:
> >
> > Pascal program compiled with `fpc polynom.pas` and then timed:
> > real    0m22.445s
> > user    0m20.875s
> > sys     0m0.014s
> >
> > Gambas program executed with `time gbs3 -f -c polynom.gambas`:
> > real    0m11.303s
> > user    0m10.297s
> > sys     0m0.035s
> >
> >
> > Lee
> >
> >
> > On 10/11/2014 02:37 PM, Jussi Lahtinen wrote:
> >> As you can see, my numbers are something completely different. My test
> >> was
> >> done with Intel Core2 Quad @ 2.83 GHz. And the Pascal version was
> >> compiled
> >> with "fpc polym.pas".
> >> What kind of system ran the Gambas code in 18 seconds!? And yet, how
> >> did it
> >> spend 7 times more time on the Pascal program than my system!?
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list