MinedMap icon indicating copy to clipboard operation
MinedMap copied to clipboard

Multithreading support

Open roman901 opened this issue 5 years ago • 4 comments

Very simple, but working region rendering parallelism, driven by ctpl library. Renderer took number of cores by std::threads::hardware_concurrency() and creates thread pool.

Speed of big worlds rendering dramatically increased

roman901 avatar May 17 '19 20:05 roman901

What do you think about this thing? (Bump)

roman901 avatar May 25 '19 18:05 roman901

I'd like to have a command line argument for the number of threads, defaulting to 1. I'm running Minecraft and MinedMap on the same hardware, and MinedMap usually

  • only regenerates very few tiles, making updates finish quickly -> multi-threading is not that useful
  • has low priority, so using more than one core is undesirable

The multi-threading feature is very useful for the initial run or full regeneration of the map after MinedMap updates though, so I'm generally in favor of merging this.

neocturne avatar May 25 '19 19:05 neocturne

Also, one actual issue: the thread pool must be finished before makeMipmaps is called, as makeMipmaps uses the generated images as input.

In a second step, multi-threading should be added for makeMipmaps as well.

neocturne avatar May 25 '19 19:05 neocturne

I'm use MinedMap on 30-40gb map and update took around a minute, multithreading makes in much faster.

OK, will see what I can do with mipmaps!

roman901 avatar May 25 '19 20:05 roman901