Enhancement #540
Scope comparison still expensive
Status: | Closed | Start date: | 09/03/2011 | ||
---|---|---|---|---|---|
Priority: | Normal | Due date: | |||
Assignee: | S. Wrede | % Done: | 40% | ||
Category: | Performance Optimization | Estimated time: | 2.00 hours | ||
Target version: | rsb-0.10 |
Description
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.
Associated revisions
better handling of Scopes in Informers, refs #540
- Return scopestring and components as reference
- Faster creation of scopestring
refs #540
make the scope ptr optimization backwards compatible by introducing a separate method getScopePtr with the new semantics.
refs #540
History
#1 Updated by J. Moringen over 11 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.
#2 Updated by S. Wrede over 11 years ago
- Category changed from C++ to Performance Optimization
#3 Updated by S. Wrede over 11 years ago
Also check that the copy constructor actually copies the cache object.
#4 Updated by S. Wrede over 11 years ago
- Description updated (diff)
- Assignee set to S. Wrede
- Target version set to rsb-0.10
- Estimated time changed from 1.00 to 2.00
#5 Updated by S. Wrede over 11 years ago
- % Done changed from 0 to 40
Event now stores a ScopePtr (currently a shared_ptr). The participant's ScopePtr is now copied when new Events are constructed upon call to publish. Added also some convenience functions to work with scope values in Event.h.
#6 Updated by J. Wienke almost 11 years ago
Is there any reason that this issue is still open?
#7 Updated by J. Moringen over 9 years ago
- Status changed from Feedback to Closed
Reopen if this problem surfaces again.