This project proposal spun out from the discussions made to 'Optimizing Away the Use of Strings as Handles'. In a nutshell, the discussion revolves around changing the handles to resources being a string to something that has a better (faster) comparison during runtime.


When a resource is being requested the potential runtime complexity of the search is O(N LogN). This is because the search complexity of std::map, which Ogre uses for storing the mappings of resource handle to Ogre::FileInfo is O(Log N), while the string comparison complexity is O(N).

This doesn't sound too bad, but as resource entries increases, so does this complexity. This can lead to resource load times, in those cases, to an excess of 10 secs, which doesn't sound good for Ogre. Internally, there is no need for Ogre to identify the resource with a string. Rather, it can be a number, in which case the search complexity becomes O(Log N). The string handles only serves the purpose for the user to find a resource based on the resource name and to it makes the scenario of searching resources with a wildcard possible.

We, the authors of this article, believe there should be a better solution that allows for such functionality that doesn't require strings to be the handle to resources.

Current Scenarios of Using Strings as Resource Handles




How Does the Proposal Change Current Scenario?



TBD: Link to forum discussing about this proposal