Re: Why is this so slow?



If you have memory read+write accesses you're bound to be slower than if you just have write access, because in the first case, well, the CPU has to access the memory, make the calculation and store the result. In the second case, you just store the result.

If your DIB is in AGP memory (dunno if that's your case), then things could get really ugly since AGP memory isn't cached: the write-only code would be able to make use of write combiners, but the read/write code wouldn't, so if it were slower by a factor of 32 to 64 (depending on CPU model) it wouldn't be surprising.

Eric
.



Relevant Pages

  • Next July 27: boot failure(hang) on x86_64 box.
    ... Freeing unused kernel memory: 1360k freed ... ACPI: PM-Timer IO Port: 0x488 ... CPU: L2 Cache: 1024K ... # AX.25 network device drivers ...
    (Linux-Kernel)
  • [PATCH] Document Linuxs memory barriers [try #3]
    ... The attached patch documents the Linux kernel's memory barriers. ... I've tried to get rid of the concept of memory accesses appearing on the bus; ... barring implicit enforcement by the CPU. ...
    (Linux-Kernel)
  • Oops in 2.6.28-rc9 and -rc8 -- mtrr issues / e1000e
    ... Bios 1.04beta did show correct memory sizing in dmidecode, ... I hope this is as simple as me doing something glaringly wrong in the kernel ... DMI present. ... CPU: L2 cache: 6144K ...
    (Linux-Kernel)
  • Re: read vs. mmap (or io vs. page faults)
    ... not fit in main memory, and there are overheads related to the heuristics ... But because the CPU is underutilized, ... reasonably sized user buffer). ... You have to measure the actual overhead to see what the actual cost is. ...
    (freebsd-questions)
  • Sun Fire v440 hardware problem (cant get ok>)
    ... 0>Init CPU ... 1>Set JBUS config reg ... 0>Probe and Setup Memory ... Could not read diag-level from NVRAM! ...
    (SunManagers)