Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure trailing slash for string used as key in AssemblyTableInfo's c…
…ache (#8266) * Ensure trailing slash We do exact string comparisons with this path, and it is user-provided, so if it does not include a slash, we may do slightly more work. *How did you discover this?* I was working on a larger change around caching in RAR and trying to get a general idea for how things worked when I noticed this. I finished the larger change, but it didn't actually seem to really affect performance, so I don't think it's worth a PR. I started another change as well that might improve perf, but I haven't finished that one yet. *Can you describe the situation where a user might hit the miss?* This is a bit narrow, but if you pass in exactly one TargetFrameworkDirectory, it doesn't end in a slash, and ou also pass in one or more AssemblyTables with FrameworkDirectory metadata, that un-normalized directory will be part of the key into s_cachedRedistList here. If you then specify one or more LatestTargetFrameworkDirectories, those will be compared against that directory here. Looking at that more, though, I do think my current change is insufficient, and I should apply normalization across the board. I had tried to just align with the other code path in that method that was doing some light normalization, but it looks like we aren't even consistent on whether we try to normalize the path. I'm sure it isn't a huge perf loss, but it still is slightly wasteful. I'm a little split between normalizing every instance in which we make these paths versus normalizing just before using the key; the latter is easier but would probably be a bit more allocate-y. Maybe not, though? I'll look more.
- Loading branch information