Optimize read/write huge data (C++)

前端 未结 8 1340
Happy的楠姐
Happy的楠姐 2021-02-06 09:22

I am looking to optimize reading/writing huge data for a C++ simulation application. The data termed as a \"map\" essentially consists of integers, doubles, floats and a single

8条回答
  •  青春惊慌失措
    2021-02-06 09:41

    Maybe not relevant in this case, but I managed to increase performances in an application with heavy file read and write by writing compressed data (zlib), and decompressing on the fly, the decreased read/write time versus the increased CPU load being a win.

    Alternatively, if your problem is that the amount of data does not fit in memory and you want to use the disk as a cache, you can look into memcached, which provides a scalable and distributed memory cache.

提交回复
热议问题