I'm creating a file-based Octree of a Point Cloud in order to manage filters on really big file (that can't be stored in ram). The bottleneck of this method, so far, is the I/O of the leaves (because I often have to write, rewrite files and read files ...)
So I would like to use memory mapped file technique to make it faster, and I heard about Boost.
But when I search for tutorials, I have seen 2 techniques :
One use #include <boost/iostreams/device/mapped_file.hpp>
and the other
#include <boost/interprocess/file_mapping.hpp>
.
In my casae, I will have to write really often entires vectors of 3D points in file, then get all informations in these files and recreate vectors from them. A lot of I/O operation with probably a lot of files.
I was wondering which one I have to use? In which case I have to use one instead of the other?
Thanks!
P.S : Is there a difference between boost iostream mapped file and boost interprocess mapped file? I have seen this post, but it doesn't help me for my particular problem.
You can use any of these, however:
boost::iostreams::mapped_file
object you get a file mapped into memory with array interface. It doesn't get any simpler than that. You can also use boost::iostreams::stream
decorator to attach std::iostream
interface to the mapped file.boost::interprocess::file_mapping
requires using boost::interprocess::mapped_region
to map the file_mapping
into memory. This method is more flexible as it allows to map parts of the file (rather than the entire file) with different access permissions but it is also more complex.