Repository navigation
Replies: 1 comment
|
So your instinct is right. Read it once per file (or once per project) and pass the value down: // once, where you get the check results
let projectFileName =
try Some checkFileResults.ProjectContext.ProjectOptions.ProjectFileName
with _ -> None // ProjectOptions throws under the transparent compiler
// then put projectFileName into the rule context instead of the check resultsIf you already have the If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm not sure if this would be classed as a bug or not, or an existing poor usage on an api (or is covered by one of the several other existing .NET 10 FCS performance issues), so -
I've been having a go at updating FSharpLint from FCS 43.9 to 43.10 - fsprojects/FSharpLint#770
That was working ok until another change was made to access ProjectContext.ProjectOptions.ProjectFileName in several places to use the project file name if available - e.g. https://github.com/webwarrior-ws/FSharpLint/blob/c378757ad49d9a0c9eedbf228ced722245643978/src/FSharpLint.Core/Rules/Conventions/Naming/AsynchronousFunctionNames.fs#L36
That change seems to cause a small performance degredation in FCS 43.9 but in 43.10.100 it caused performance to fall through the floor (running a lint on FSharpLint itself in the CI started taking 30 minutes or more when it was more like 5 before.)
That also seems to be worse in 43.10.103 - The CI for that at https://github.com/fsprojects/FSharpLint/actions/runs/21900557463 took over 2 hours rather than the usual 25 minutes.
I tried profiling it and that said that pretty much the entire time was spent getting the project contenxt - see fsprojects/FSharpLint#770 (comment)
Anyway, I think it'd be better in general to pass this information down from the top rather than reading the options locally on every use as is done in the F# Analyzers SDK so maybe it's an easy fix, but I'm querying anyway because this seems like quite an extreme performance degredation between versions.
Thanks.
All reactions