This reworks current implementation of casts as a linked list with entries that get promoted to the beginning of the list when they are matched at runtime. The rationale for this was apparently performance improvement for cases when there was a function accepting a reference to a base class with a large number of derived types of which only a subset that was actually used. This resulted in a significant speed up, however it also effectively precluded a model with multiple interpreters accessing swig-bound infrastructure from multiple threads.
For example, see
It a nutshell, this patch replaces the linked list with a list of arrays that does not get modified at runtime. The content of the cast arrays is sorted during the initialization so that subsequent lookups can use binary search over the entries obtaining O(log n) performance.
Log in to post a comment.