Using stl::robin_map instead of std::unordered_map

Not sure if I should mention this here or at right-click.

When recently trying to build with v2.1.10.0 of oiio I discovered an issue that is now fixed for the next oiio release.

While this oiio fix will allow cycles to build with oiio 2.1.11, the issue was due to cycles using std::unordered_map with oiio::unordered_map_concurrent. It was suggested here that using stl::robin_map would offer performance improvements as well as matching the intended use of oiio.

1 Like

Hi there.

Besides performance, is this actually fixing any bug? If so what exactly? Just trying to see where does that fit in our roadmap (how pressing this matter is)

@brecht are you aware of this?

I’m aware, but the code using this is not really performance critical. tsl::robin_map would require adding an extra library dependency, that’s not worth it here.

@dfelinto Only blender failing to build with oiio v2.1.10.0 but that will be fixed with the next oiio release, so no real bug, just suggesting a possible performance benefit mentioned during the oiio bug report.

@brecht Yeah, it appears to only be used once per material with an image texture node during render setup and not called while rendering. I guess in really large scenes there could be some benefit, but it would still be small compared to render time. If the deps list was an issue, robin_map is only a few C++ header files, being MIT licensed they could be copied into blenders tree.

If you are aware of robin_map and know it is of little benefit then just ignore this idea.