ufrisk / MemProcFS

MemProcFS
GNU Affero General Public License v3.0
3.05k stars 372 forks source link

Which is more efficient for random memory reads: sequential read or scatter? #329

Closed cur-114 closed 1 day ago

cur-114 commented 1 day ago

Question: I am working on a project using an FPGA and would like to get advice on the most efficient memory access method for the following scenario:

There are 500 consecutive memory locations, each of size 0x8, stored in memory. Out of these 500 entries, I need to randomly read 200 entries. Similarly, I may also need to write to random 200 entries.

In this case, would it be better to: Read all 0x8 * 500 bytes sequentially and then pick the 200 entries, or Use scatter read operations to directly fetch the 200 random entries?

Additionally, which approach would be more efficient for writes in a similar scenario? Are there any specific performance considerations I should keep in mind?

ufrisk commented 1 day ago

I'm closing this issue since it's not an issue, i.e. enhancement request, bug report etc.

For general questions the Discord server is a better choice.