See the C++ API documentation for: mrpt::slam::COccupancyGridMap2D (part of the library mrpt-maps)
....


The next graphs summarize the performance of the most common operations on grid maps. The results have been generated by the program "samples/benchmarkGridmaps", on a Intel Core 2 Duo 2.2Ghz, MRPT version 0.5.5, averaging over thousands of repetitions.

Some comments about the obtained times:
The selection of likelihood function is made through the member COccupancyGridMap2D::TLikelihoodOptions. Refer to the doxygen documentation for all the details. In the following only a basic description of each method is provided.
....
....
....
....
There are two main methods for inserting a laser scan in a gridmap: with and without widening the beams. To clarify the differences, see the next animation which compares both methods:

....
....
With COccupancyGridMap2D::loadFromBitmapFile the bitmap can be loaded from any image (png,bmp,etc.). You should specify the size in meters of one pixel, and optionally, the (x,y) coordinates of the map center (0,0 by default).
....
With COccupancyGridMap2D::saveMetricMapRepresentationToFile, two files will be generated (at least): one with an image representing the gridmap, and another text file with the (x,y) coordinates of its limits. In this way, it's easy to import the gridmap in Matlab, for example.
....
To load or save a gridmap to a binary file, use the MRPT standard CSerializable interface: {syntaxhighlighter brush:cpp} COccupancyGridMap2D gridmap; CFileInputStream in_s("file.gridmap"); in_s >> gridmap; CFileOutputStream out_s("another_file.gridmap"); out_s << gridmap; {/syntaxhighlighter}
....
....
...