Performance of RevMedia on matrix diagonalization

Piero Ugliengo piero.ugliengo at gmail.com
Fri Aug 28 02:19:48 EDT 2009


Dear Viktoras, thanks a lot for the suggestions. Yes VB is compiled
(although in a sort of p-code) and it isexpected to be faster than any
scripting language. I did't try to do what you have suggested because I am
not
mastering other languages but VB6 and FORTRAN. I am also convinced that
trying to rewrite matrix algebra using
the very fast routines provided natively by Revolution will improve the
matters a lot. As usual, because I am not
a professional in this field, I have to find some time to do that!
Cheers
Piero

2009/8/27 viktoras d. <viktoras at ekoinf.net>

> Hi Piero,
>
> declaring local/global variables in functions and handlers should slightly
> add to speed. Populating arrays in advance with zeros so that array size
> won't change inside loops might also be of some value. However, please
> correct me if I am wrong, VB6 is compiled while Revolution is interpreted,
> therefore much slower. Did you try implementing same algorithm in other
> interpreted languages (javascript, php, perl, etc?) it would be interesting
> to do some benchmarking :-)
>
> Using native functions: matrixMultiply(firstArray, secondArray),
> transpose(array) where possible would also increase speed as they are really
> fast.
>
> Best wishes
> Viktoras
>
> Piero Ugliengo wrote:
>
>> I am completely new to Revolution. I have downloaded the RevMedia alpha
>> version and played a bit with it. I was impressed by how fast I was able
>> to
>> port a little VB6 code to RevMedia. This code diagonalizes a symmetric
>> matrix using the Jacobi algorithm. I checked against the VB6 code and I
>> got
>> exactly the same results in the same number of iterations so that numerics
>> is the same. However the RevMedia code is at least one order of magnitude
>> slower than the VB6 one. For instance a 50x50 matrix is diagonalized in a
>> couple of seconds in VB6 and it tooks more than a minute on RevMedia. I
>> know
>> that RevMedia is not meant for numerical intensive calculations; however,
>> I
>> would like to use it in a scientific teaching context so some power is
>> needed. I wonder if anybody much expert than me can try the code using the
>> most powerful Revolution Studio and if there is a clever way to deal with
>> matrix algebra.
>> The link to download the rev script is here:
>>
>> http://sites.google.com/site/pierougliengo/download-1/test.rev?attredirects=0
>>
>> <
>> http://sites.google.com/site/pierougliengo/download-1/test.rev?attredirects=0
>> >One
>> can set the size of the matrix in the onmouse routine.
>> Thanks a lot
>> _________________
>> Piero Ugliengo
>>
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
Prof. Piero Ugliengo
University of Torino
Dip. Chimica IFM,  Via P. Giuria, 7 I-10125 Torino
ITALY
Phone: +39-011-670.4596
FAX:   +39-011-236.4596
E-mail:  piero.ugliengo at unito.it
Home page:
http://web086.unito.it/cgi-bin/chimifm/persone.pl/Show?_id=ugliengo&sort=DEFAULT&search=&hits=70
MOLDRAW: http://www.moldraw.unito.it



More information about the use-livecode mailing list