commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: [math] Re: [LINEAR] Performance and bugs of 2.0 library
Date Tue, 02 Feb 2010 19:44:48 GMT
Peter A a écrit :
> All,
> 
> I posted the new stability and runtime performance benchmarks at:
> 
> http://code.google.com/p/java-matrix-benchmark
> 
> This includes the 2.1a SVN code from last Friday.  I don't really see much
> of a change since 2.0.

>From a pure performance point, there should not be any differences. The
expected changes are more that some (not all ...) SVD cases are now
handled properly (or at least compute something).

> If a commons-math developer has some time it would
> be helpful if he/she/it could take a look at:
> 
> jmbench.impl.runtime.McBrAlgorithmFactory.java
> 
> and tell me if I'm testing commons-math correctly.

You should probably add a separate benchmark using Array2DRowRealMatrix
instead of BlockRealMatrix. Depending on the dimension and on the
operation, one matrix type may be better suited than another one. In
fact I also wonder if we should not add another type someday with a one
dimension array as suggested some months ago on this list.

The current suggested way to use one type or the other is to rely on
MatrixUtils.createRealMatrix(rows, columns). The method simply check
whether the number of elements is greater than 4096 or not. Small
matrices are created as Array2DRealMatrix, larger matrices are created
as BlockRealMatrix. This choice was OK for simple operations (multiply,
add, transpose ...) on my machine this summer, but is certainly not a
good general choice. Having separate reliable benchmarks from your tool
would allow to improve at least documentation and hints to user on which
type they should use depending on the most costly operation they perform.

Luc

> 
> - Peter
> 
> On Sat, Jan 30, 2010 at 1:58 AM, Ted Dunning <ted.dunning@gmail.com> wrote:
> 
>> This comparison is also confounded by the fact that most C++ libraries try
>> to make use of native binary libraries such as ATLAS and often get a
>> dramatic speedup as a result.
>>
>> On Fri, Jan 29, 2010 at 4:55 PM, Peter Abeles <peter.abeles@gmail.com
>>> wrote:
>>> I have seen some adhoc comparisons on-line. Mostly just matrix multiply.
>>> Having said that I wouldn't be surprised if I missed something.  Based
>>> on personal experience I would expect about a 2-3 times speed hit
>>> between well written java and c/c++ code because of array overhead and
>>> language constraints.  For pure arithmetic I have gotten nearly
>>> identical performance.
>>>
>>
>>
>> --
>> Ted Dunning, CTO
>> DeepDyve
>>
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message