[Gambas-user] VB6 to Gambas Global arrays

R A Turney raturney at ...159...
Mon Jul 17 19:13:18 CEST 2006


Ron Onstenk wrote:
> On Monday 17 July 2006 04:24, R A Turney wrote:
>> I have noticed that the Gambas program is very slow in its computation 
>> compared to VB6.  
> 
> If you are using the old machine not usable for winXP /Vista by lack 
> of speed and memory but still usable with linux then you are right.
> But what do you exactly mean with computation?
> 

I am converting an engineering application that I wrote in VB6.  It 
calculates the von Mises operating envelope for a cylindrical pressure 
vessel (just mentioned that because some might be familiar with this). 
This involves an iterative calculation, calling many subroutines per 
iterative cycle.  As a result of this calcultion a graph is plotted that 
is shaped like an ellipse that is tilted slightly to the right.  The 
original Win XP VB6 program does the iterative calculation and plots the 
graph almost instantaneously (less than a second) on an Intel Xeon 1.8 
Ghz.  On my "converted to Gambas" version running on my home computer, 
AMD Athlon XP 2000+, and SuSE 9.3, it takes roughly ten seconds.  That's 
why I assumed it was interpreted code.  I am hoping that after my direct 
conversion that I can find ways to optimize this code to improve the 
performance.

> The CPU executing the bytes in the result file (*.exe) or the calculation of sqr(2).
> 
> For the first you are almost right, the CPU must interprete the bytes
> from the gambas interpreter (gbi) and that one the bytes from the 'compiled'
> gambas file (myprogram.gambas). 
> 
> For the second I'm not 100% sure but in general I can say safe there is 
> no big difference.
> 
>> I am hoping that this is because it is interpreted  instead of compiled. 
> 
> Hummm.
> Gambas is also compiled. (so the hope is false)
> For a *.exe the CPU must also interprete the bytes in memory.
> Oeps. that declares why any program is always so slow :)
> 
> Compile does only mean 'convert from human readable text a bunch of bytes'
> The bytes can be bytes that the CPU interprete or bytes that a 
> virtual CPU interprete and that is for gambas code called gbi or gbi2.
> The later also known as bytecode or p-code.
> 
> Beside of that VB6 is also not 100% CPU executable code (bytes) in the result file.
> It uses a mix of bytecode and real CPU bytes and a small interpreter in the
> resulting program. 
> You have to set a option in the configuration of VB6 to effective change  bytecode to CPU code.
> 
> i.e.
> using a array of bytes to prepare a call to a dll 
>   DD FA (use Function Add(val1,val2) as integer)
>   D2 04 (first value 1234)
>   2E 16 (second value 5678)
> 
> or the code for the dll call with the initialise for that call
>   21 04D2 (mov ax 1234)
>   E5      (push ax) 
>   21 162E (mov ax 5678)
>   E5      (push ax)
>   CD 12BEFA34 (call 12BEFA34 ;the ADD routine address) 
> 
> 
> It needs msvb6vm.dll for the major components as gambas uses several libraries. 
> The main library are lib.gb.so and lib.gb.qt.so or lib.gb.gtk.so for gambas
> 
>> I don't think I can make an executable in this  version. Is this correct? 
>>
> If you mean a 100% direct by the CPU executable/interprete byte array you are correct. 
> But a bash script or in msdos a *.bat file are that no executables?
> They are totally _not compiled_ at all and still do the job you want.

The older version I was using 1.0.11 could create an executable that 
showed up in Konqueor as a Gear.  You could double click it to execute.

> 
> 
> 
> Greets,
> Ron
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> 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