New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache reflection portion of SettingSource
lookups
#14674
Conversation
Fixes the mod-related overhead portion of ppy#14638. There's still a significant performance issue that will be addressed separately.
To expand on why I'm not sure about this direction: it doesn't change the fact that in the If we go with this cache, it's still something to keep in mind. |
This can't work as written, sorry for misleading (as evidenced by test failures). The binding to the generic method happens at compile time, so all readers that call this on |
Yeah, was just looking into this, unfortunate. |
Umm, right... I should have seen that coming but somehow didn't... The next best thing to use as a cache key (that doesn't touch reflection) would be a Maybe |
upon checking again,
still doesn't change the fact that the cache initialisation (so first call to |
it’s not the initialization. my profiling was of course done after ensuring the cache was initialized. |
As I said in Discord, it is very likely that we're being misled here and it's not actually reflection that's taking a long time but the fact that we're allocating a lot during this.
|
Attempting to drill down into allocations, while there is some overhead on our side, the majority is still coming from I'll dig deeper and try to isolate a repro case. As you mentioned, it may be async/threading specific, or potentially something to do with the size of the json being parsed here. |
Closing this as neither solution is valid. Am investigating today, if I don't come up with a solution I'll open an issue tracking it. |
This is actually valid with the embarrassing fix that none of us caught: base
this PR:
|
Updated benchmarks (with master:
this pr:
|
Fixes the mod-related overhead portion of #14638. There's still a significant performance issue that will be addressed separately. Still not sure if this is 100% correct direction but seems to work well enough.
Before:
After:
(gone)