datastore readsize and buffer chunk
8 views (last 30 days)
Show older comments
Peng Li on 12 May 2020
Commented: Peng Li on 18 May 2020
I am working with a single csv file of over 10G size. I'm trying to use mapreduce to perform some analyses. The program works as expected but I'd like to speed a bit by increasing readsize.
Currently, it only passes about 1500 rows each time, although by default it is 20000 rows. I have in total over 500k rows so this creates a lot of passes that significantly slow the process.
After looking into the tabulartextdatastore, it seems that the buffer chunk that has been hardcoded to be 32MB that limits this.
So my questions are:
1) What the consideration is that MATLAB applies this 32MB buffer size
2) Whether there is a good way to manipulate this as I'd like to decrease the number of passes while increase the size within each pass (I have about 400G RAM).
Rashed Mohammed on 18 May 2020
Hi Peng Li,
The “ReadSize” name value pair of “tabularTextDatastore” specifies the number of rows to read at most. However, it is bound by the chunk size depending on the data to efficiently manage the datastore. In your case, I would suggest you to look into partitioning the datastore and read the data in parallel. Here is a link to go through.
Hope this helps!
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!