Skip to content
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

Reduce calls to checkPathForIllegalChars #1677

Merged
merged 1 commit into from
Oct 28, 2016
Merged

Reduce calls to checkPathForIllegalChars #1677

merged 1 commit into from
Oct 28, 2016

Conversation

KevinRansom
Copy link
Member

This function

type AssemblyReference = 
    member x.SimpleAssemblyNameIs(name) = 

calls fileNameWithoutExtension which in turn calls checkPathForIllegalChars. However, x.SimpleAssemblyNameIs only uses the result of fileNameWithoutExtension to compare with a passed in Value name.

So there is no real reason for validating that fileNameWithoutExtension has illegal chars, since it will just fail to match the name.

This reduces the number of calls from

checkPathForIllegalCharsCalls : {contents = 947;}
fileNameWithoutExtensionCalls : {contents = 745;}

down to

checkPathForIllegalCharsCalls : {contents = 203;}
fileNameWithoutExtensionCalls : {contents = 745;}

@vasily-kirichenko
Copy link
Contributor

< 1000 calls?...

@KevinRansom
Copy link
Member Author

@vasily-kirichenko yes less than 1000 invocations when compiling fsharp.core.dll using the open source build.

@vasily-kirichenko
Copy link
Contributor

It would be more interesting to collect number of calls during editing a file for some time.

@dsyme
Copy link
Contributor

dsyme commented Oct 28, 2016

The code looks fine

@KevinRansom KevinRansom merged commit ca5eadb into dotnet:master Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants