gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic mutidimensional arrays


From: Fischlin Andreas
Subject: Re: Dynamic mutidimensional arrays
Date: Wed, 5 Apr 2023 09:11:17 +0000

See below

On Wed, 05.04.23, at 11:00, Benjamin Kowarsch <trijezdci@gmail.com> wrote:

Hi

On Wed, 5 Apr 2023 at 17:46, Fischlin Andreas <andreas.fischlin@env.ethz.ch> wrote:
Have you actually looked at LgMatrices? There is no such run time penalty from calling a procedure such as value(M, i,j). You simply write e.g.

     val := A^[i]^[k] * B^[k]^[j];

But that will lead to unnecessary cache misses because of multiple levels of indirection.

Indeed, I overlooked that point.


If you have such an _expression_ deeply nested in a loop, these cache misses will add up and significantly impact performance.

It is better to allocate all metadata (such as length of a vector) and payload data together in a single memory block. This is called data locality.

regards
benjamin

Cheers,
Andreas

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]