Re: Autocorrelation matrix of a long sequence



On 16 Apr, 23:27, SG <s.gesem...@xxxxxxxxx> wrote:
On 16 Apr., 22:52, Vladimir Vassilevsky <antispam_bo...@xxxxxxxxxxx>
wrote:

sasuke wrote:
Hi

I am using MATLAB to generate close to 10^8 samples

First mistake. Don't use MATLAB for serious computations. A plain C++
program runs ~10 times faster.

This statement is far too general.

Unless you have stripped the operations down to the core
BLAS/LAPACK level, Vladimir is right. There is the interpreter
overhead as well as the call-by-value function call overhead,
which take a lot more time than people realize. More below.

It's not easy to compare the
performances on this level. The programming style is different. If you
want your Matlab code to run fast you usually exploit all the built-in
functions (which map to ATLAS, FFTW, ....) and operate on a matrix/
vector level as opposed to touching every scalar by hand.

And you have to throw every good programming practice
down the drains. One aspect of matlab is that variables
are passed between functions by copy, not by reference,
which means that local copies of variables are found
all over the place.

This first of all consumes memory but also consumes lots
of time copying variables back and forth, where one would
use pointers or references in C or C++.

The solution is to avoid using functions, thus forefeiting
testing habits, code reusability and source code managment.

But this may
also lead to higher memory requirements than what would be necessary
in case of C or C++.

Nope. It *might* not spend more memory. It *certainly* makes
the program blow up and grab all the memory it can get.

Rune
.



Relevant Pages

  • [RFC] page replacement requirements
    ... Submitting too much I/O at once can kill latency and even lead to deadlocks when bounce buffers are involved. ... Must be able to deal with multiple memory zones efficiently. ... When on completion of the write to their backing-store the reference bit is still unset a callback is invoked to place them so that they are immediate candidates for reclaim again. ... For traditional page replacement algorithms this is not a big issue since we just implement per zone page replacement; ...
    (Linux-Kernel)
  • Re: [PATCH 1/3] sysfs: simplify handling for s_active refcount
    ... a sysfs file when that sysfs file is being removed. ... guarantees that we don't take a new reference after the last one is gone. ... We are not talking about memory ordering requirements. ...
    (Linux-Kernel)
  • Re: Java Memory question
    ... freed when the last reference to an object is lost. ... an Object array, or as objects in a class. ... Or is there a better way to move it without eating double memory? ... Instance variables exist from the time they are created (when the object ...
    (comp.lang.java.help)
  • Re: Java or C++?
    ... >> CTips wrote: ... GC can only kick in when the last reference has ... If f was already bound to a lot of memory when it enters do-it then ... > more than the extra memory leaked because of sloppy manual deallocation]. ...
    (comp.programming)
  • Re: 4-way Opteron vs. Xeon-IBM X3 architecture
    ... >>>The point here is that the issue concerns both speed AND capacity. ... >As to the reference, the message header points right back in this thread, ... >>>As you may suspect, I read plenty about memory systems, and I would ... >>>from the enthusiast market and assumed that it would work in the server ...
    (comp.sys.ibm.pc.hardware.chips)