• Re: Scanning memory forward vs. reverse

    From Bonita Montero@3:633/280.2 to All on Tue Jan 30 21:47:48 2024
    Am 29.01.2024 um 23:12 schrieb Chris M. Thomasson:
    On 1/29/2024 12:56 AM, Bonita Montero wrote:
    Am 28.01.2024 um 20:18 schrieb Chris M. Thomasson:

    Try padding and aligning the blocks. iirc, std::vector works with
    alignas. Actually, it's pretty nice.

    I'm testing all 64 offsets. If offset zero becomes physically offset
    one in the cacheline doesn't matter since physical offset zero would
    then be occupied by logical offset 63.


    You don't want to straddle any cache lines. ...

    I'm testing all 64 offsets and for my measurement it doesn't matter if
    the beginning of the block is at offset zero inside a cacheline since
    the result show equal access times for all offsets.
    If there were different results it might have made sense to have proper alignment.


    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Vir Campestris@3:633/280.2 to All on Thu Feb 1 02:56:01 2024
    On 28/01/2024 10:19, Bonita Montero wrote:
    On my Windows 7050X Zen4 computer scanning memory in both directions
    has the same speed. On my Linux 3990X Zen2 computer scanning forward
    is 22% faster. On my small Linux PC, a HP EliteDesk Mini PC with a
    Skylake Pentium G4400 scanning memory forward is about 38% faster.
    I'd first have guessed that the prefetchers between the memory-levels
    are as effective for both directions. So I'd like to see some results
    from you.

    On my Linux box with an AMD Ryzen 5 3400G it's about 11% slower for the
    second number. But that's a very about, it's doing something else right
    now and that's the average from several runs - where the ratio is
    between 97% and 130%.

    Andy

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)