Closed simonhatch closed 6 years ago
Replacing self[name] = diag
with dict.__setitem__
bypasses the consistency checks in DiagnosticMap.__setitem__
, which arguably might be safe considering ResolveSharedDiagnostics is only called in ImportDicts, but I'm confused because that wouldn't affect LookupDiagnostic. LookupDiagnostic is just a getitem, which should be extremely fast.
I'll rename this, at the time I didn't know what specifically was slow but edited the description later with the line that I tried swapping out.
Was doing some light profiling on the dev server, noticed that seemingly more than 50% of the time for importDicts seems to be in the diagnostic lookup. If someone can confirm and see if there's anything super easy to fix.
Specifically ResolveSharedDiagnostics, replacing self[name] = diag with dict.setitem(self, name, diag) seems to make the time disappear.
@benshayden @eakuefner