-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
remove dead code from nativemethods #10840
base: main
Are you sure you want to change the base?
Conversation
Hello @kasperk81 - thank you for your contribution! MSBuild team for sure appraciates contributions. Upfront heads up via bug or other form of discussion is preferred (plus an explicit confirmation of wanting to fix). More details: https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Contributing-Code.md Each PR should ideally have motivation and goal in the description (links are big advantage, but important context should be part of the PR). By no means would I want to kill the interest and flow :-) But it should be just little extra work that will save us considerable time. In this specific PR - it mentiones it's a followup of the other PR that uses IO.Redist on NetFx, while here only single implementation is used - it's bit confusing to me. It looks great as code cleanup. Though as mentioned followup I'd expect the usage of IO.Redist or justification why not using it |
the change in WindowsFileSystem.cs is following the other pr, MSBuildTaskHostFileSystem.cs is only built on netfx so it didn't required netcore tfm branch and that's the only difference there. |
Is it just code removal though? The previous implementation of msbuild/src/Framework/NativeMethods.cs Lines 1865 to 1869 in d8d42ef
It looks like a change in a good direction. It however doesn't look like dead code removal. Let's please add a motivation + reaso ning into PR description so that we can proceed with reviewing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Jan here, please add more about the context as it is a bit hard to understand where these changes are coming from.
@JanKrivanek seems like we are reading too much into semantics in a simple code cleanup moving stuff from native to managed. not the first pr of its kind in this repo. p/invoking win32 api for file.exists check looks to be some legacy from 90s which is no longer needed as green ci status is showing up here |
How did you evaluate the perf impact of this? Historically we've used a variety of P/Invokes on Windows because they could be tuned to be faster than the BCL mechanisms. Because of that I'm hesitant to remove any without some fairly detailed perf analysis work. |
here is the benchmark https://gist.github.com/kasperk81/6e0c449a88ef95df8b30f1d9d5db4771 on windows vm
no difference, if fraction of nano-seconds count then the change is better but i'd rule it out as noise. framework seems to be doing an ok job |
followup on #9223