You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExecutionSession::lookup currently makes several copies of the SymbolStringPtrs involved in the lookup. As of f9aef47 they're present in at least the AsynchronousSymbolQuery and the InProgressLookupSet::LookupSet member. They're also at least partially duplicated in the DefGeneratorCandidates and DefGeneratorNonCandidates sets of InProgressLookupSet.
If we introduced a new SymbolStringWeakPtr class (and probably a weakly-referencing version of LookupSet built on top of it), we could probably avoid many of these copies.
Note: Naming the weakly-referencing LookupSet will be an interesting exercise: We need to disambiguate weak reference (in the shared-ptr sense) of symbol strings and weak reference (in the linker sense) of symbols. Maybe SymbolStringUnsafePtr would be better? Or SymbolStringUnretainedPtr?
The text was updated successfully, but these errors were encountered:
More potentially unnecessary SymbolStringPtr copies: EPCDynamicLibrarySearchGenerator::tryToGenerate is copying SymbolStringPtrs to build the lookup set that it will pass to ExecutorProcessControl::lookupSymbols, but the lookupSymbols method could probably be rewritten to use StringRefs instead. If that's the case we could save the copies here.
lhames
changed the title
Add SymbolStringWeakPtr, use it to avoid SymbolStringPtr copies during lookup.
Reduce SymbolStringPtr copies.
May 19, 2022
JITDylib's MaterializingInfosMap and UnmaterializedInfosMap members could be keyed on SymbolStringWeakPtr -- their entries should be a subset of the entries in the main symbol table.
We could probably use SymbolStringWeakPtrs in the symbol-dependence graph too. That would be a big win: copies in the dep graph will be a relatively common operation.
ExecutionSession::lookup
currently makes several copies of theSymbolStringPtr
s involved in the lookup. As of f9aef47 they're present in at least theAsynchronousSymbolQuery
and theInProgressLookupSet::LookupSet
member. They're also at least partially duplicated in theDefGeneratorCandidates
andDefGeneratorNonCandidates
sets ofInProgressLookupSet
.If we introduced a new
SymbolStringWeakPtr
class (and probably a weakly-referencing version ofLookupSet
built on top of it), we could probably avoid many of these copies.Note: Naming the weakly-referencing
LookupSet
will be an interesting exercise: We need to disambiguate weak reference (in the shared-ptr sense) of symbol strings and weak reference (in the linker sense) of symbols. MaybeSymbolStringUnsafePtr
would be better? OrSymbolStringUnretainedPtr
?The text was updated successfully, but these errors were encountered: