domlysz / BlenderGIS

Blender addons to make the bridge between Blender and geographic data
GNU General Public License v3.0
7.69k stars 1.35k forks source link

Multi-core data loading #218

Open czarmanu opened 4 years ago

czarmanu commented 4 years ago

importing a geo raster using the blenderGIS uses only one CPU-core.

Is it possible to parallellize this process to multiple cores to make it faster and efficient? This si very critical when working with huge DEMs

Thanks,

domlysz commented 4 years ago

Python itself uses only one core following global interpreter lock mechanism. However, there is a module named multiprocessing that allows splitting the execution into several Python interpreters but it's not a trivial task to implement because there are serious limitations, for example only basic datatype can be shared and, if all processes need to access the bpy API then this one need to be thread-safe which I strongly doubt.

So not to say it's impossible, it's uncertain and anyway it will be a real pain for a gain that I consider out of the scope of this addon. As explained in the wiki if you want to deal with hires and large scale DEM then blender is not a tool of choice.

Also I don't know if you import your DEM with the option Raw DEM or As DEM texture. The first one is neither optimized nor memory friendly and can largely be improved in the future, the second one use the DEM as displacement texture and give very good performance, it's the initial and preferred way to import a DEM.

czarmanu commented 4 years ago

I import it as Raw DEM