[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A faster sum
From: |
Mike Miller |
Subject: |
Re: A faster sum |
Date: |
Sat, 21 May 2005 17:06:36 -0500 (CDT) |
On Sat, 21 May 2005, Victor Eijkhout wrote:
On May 21, 2005, at 4:19 PM, Keith Goodman wrote:
So does it make sense to modify the built-in function sum to use matrix
multiplication?
I wouldn't do it.
I'm still a bit surprised. The multiplication approach takes twice as
many operations, but it's probably faster because it uses Atlas, which
tries to optimize use of bandwidth, cache lines, number of registers &c.
Since the memory behaviour is more important than the actual efficiency
of operations (to a degree), I guess the Atlas matrix-vector multiply
will be more efficient.
However, this depends on all sorts of assumptions about architecture.
I'd leave the code the way it is, and preserve this as a bit of 'octave
folklore'.
It looks like mine is compiled with libblas.so.3 (see below), which might
be causing the improved speed with "ones" instead of with "sum." Do
people often compile with no BLAS? A doubling of speed is worth
something, so I'm interested in what other people think about this.
Mike
GNU Octave, version 2.1.50 (i686-pc-linux-gnu).
ldd /usr/bin/octave
liboctinterp.so => /usr/lib/octave-2.1.50/liboctinterp.so (0xb7390000)
liboctave.so => /usr/lib/octave-2.1.50/liboctave.so (0xb7249000)
libcruft.so => /usr/lib/octave-2.1.50/libcruft.so (0xb71f4000)
liblapack.so.3 => /usr/lib/liblapack.so.3 (0xb6d49000)
libblas.so.3 => /usr/lib/libblas.so.3 (0xb6cf9000)
libreadline.so.4 => /usr/lib/libreadline.so.4 (0xb6ccd000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0xb6c8c000)
libdl.so.2 => /lib/libdl.so.2 (0xb6c89000)
libg2c.so.0 => /usr/lib/libg2c.so.0 (0xb6c6b000)
libm.so.6 => /lib/tls/libm.so.6 (0xb6c49000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6c40000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb6b8d000)
libc.so.6 => /lib/tls/libc.so.6 (0xb6a54000)
libgpm.so.1 => /usr/lib/libgpm.so.1 (0xb6a4f000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Re: A faster sum, (continued)
- Re: A faster sum, Victor Eijkhout, 2005/05/21
- Re: A faster sum, Keith Goodman, 2005/05/21
- Re: A faster sum, Mike Miller, 2005/05/21
- Re: A faster sum, Victor Eijkhout, 2005/05/21
- Re: A faster sum, Keith Goodman, 2005/05/21
- Re: A faster sum, Victor Eijkhout, 2005/05/21
- Re: A faster sum,
Mike Miller <=
- Re: A faster sum, John W. Eaton, 2005/05/21