[Gambas-user] Gambas is slower than Python??

Gareth Bult gareth at ...1689...
Sun Jan 18 03:08:56 CET 2009


>through an optimized compiler, so that explains why it is not about 50x

Mmm.. C 50x faster than Python... interesting - not in my experience - certainly not these days where 95% of code is actually library calls that are written in "C". VB 50x faster than Python ... that's a new one on me. I've used VB in the past, not something I want to do again and not the fastest dog on the track (!)

Is it possible to write your example in "C" and make it 50x faster than your Gambas example .. with inline C code and other optimisations etc, sure, but then we're not comparing like for like.

>My current project uses the Curl library and PyCurl is much more 
>configurable than Gambas's Curl component (HttpClient).

I would agree, I too have found the Curl component insufficient in the past and used Python instead.

>I may also require running my app from a dedicated server in the future, 
>so for THIS particular job, Python seems to be the best tool.

Sure, best tools for the job and all that.

>If i need more speed, i'll drop to C++. I know that i could use Regex but i
>find it very unreadable and difficult to maintain and am basically too lazy
>to learn it.

Mmm, that was my first use of "Scan", took me around 30 seconds to figure out from the docs. I always associate regex with Perl and hence avoid like the plague, but this seemed to be an entirely reasonable proposition given the Gambas wrapper.

fyi; I use "C" for system libraries and kernel drivers, bash for system admin scripts, python for back-end servers, and Gambas for anything front-end related. I know there is some desire to see Gambas as a "do-it-all" language, in reality it's strength is GUI and when it comes to speed or server stuff, there are better tools.

Conversely, people use GTK bindings in Python .. Why ?!
I understand that once upon a time it's what there was .. but not any more! 
Development time for Python or C based GUI applications is 50x more than the Gambas equivalent (in this instance I don't think the 50 is an exaggeration) and it all comes down (really) to the IDE. (IMHO)

In "real" terms Python and Gambas are about on a Par in terms of speed (last time I did some serious benchmarks) , but speed is not the reason you use either. If you *really* need the speed you have two options .. as a whole application is unlikely to feel the need for speed in it's entirety. (esp. the GUI bits!);

a. Write it purely in "C", assuming you don't need GUI stuff
b. Just write the performance sensitive bits in a C library and access from Gambas.
   (gambas can call external C libraries directly)

OR, even better, write your own code as a "C" based component for Gambas .. :-)

hth

Gareth.

----- Original Message -----
From: "birchy" <pokerbirch at ...1601...>
To: gambas-user at lists.sourceforge.net
Sent: Sunday, 18 January, 2009 12:04:36 AM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-user] Gambas is slower than Python??



Gareth Bult-3 wrote:
> Both Python and Gambas compile to pseudo code and run through an
> interpreter .. so essentially they are the same in terms of the
> performance one might expect.
My mistake, i assumed that Gambas was an optimizing compiler like VB6. I'm
actually quite disappointed with the PYTHON version as it is about 10x
slower than it is in VB6.


Gareth Bult-3 wrote:
> However, modifying the split function to read;
>   Return Scan(doc, "*WE*IO*")[1]
> 
> Reduces this to ~ 1.4s.
> 
Approx 2.9sec on my machine.

To be honest, i hadn't realised that gambas did not actually "compile" code
through an optimized compiler, so that explains why it is not about 50x
faster than Python (as expected). My current project uses the Curl library
and PyCurl is much more configurable than Gambas's Curl component
(HttpClient). I may also require running my app from a dedicated server in
the future, so for THIS particular job, Python seems to be the best tool.

If i need more speed, i'll drop to C++. I know that i could use Regex but i
find it very unreadable and difficult to maintain and am basically too lazy
to learn it.
:)
-- 
View this message in context: http://www.nabble.com/Gambas-is-slower-than-Python---tp21521606p21522547.html
Sent from the gambas-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Managing Director, Encryptec Limited
Tel: 0845 5082719, Mob: 0785 3305393
Email: gareth at ...1689... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.




More information about the User mailing list