Scope comparison still expensive
|Assignee:||S. Wrede||% Done:|
|Category:||Performance Optimization||Estimated time:||2.00 hours|
Scope comparison proved to be still expensive, when profiling RSB in some examples. Strategy for implementation:
- Per-participant caching of Scope objects and referencing of this Scope object via shared pointers, e.g., in notifications. This is necessary as otherwise Event notifications that are kept longer than the lifetime of a participant would contain invalid references. The expectation is that after this change the caching operation will eventually be effective.
- Interning across differerent participants in the same process.
A further performance improvement could be to replace the stringbuffer construction of the Scope string with a strcpy variant.
- Return scopestring and components as reference
- Faster creation of scopestring
#1 Updated by J. Moringen about 10 years ago
It probably depends on the particular usage patterns, but maybe the concept of interning could be used: if creation is (or can be made into) an infrequent operation, equality comparison would reduce to a single pointer comparison.
This technique is aleady used in cl-rsb when scopes are used as keys in associative containers.