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 allocations by favoring TryGetValue over TryFind #5715

Merged
merged 8 commits into from
Oct 2, 2018

Conversation

forki
Copy link
Contributor

@forki forki commented Oct 1, 2018

No description provided.

@forki forki changed the title [WIP] Remove old TryGetValue [WIP] Reduce allocations by favoring TryGetValue over TryFind Oct 1, 2018
@forki forki changed the title [WIP] Reduce allocations by favoring TryGetValue over TryFind Reduce allocations by favoring TryGetValue over TryFind Oct 1, 2018
@forki
Copy link
Contributor Author

forki commented Oct 1, 2018

@KevinRansom @cartermp the build error seems unrelated. Something wrong?

@KevinRansom
Copy link
Member

@forki I'm just going over the weekends PR's right now. I will get back to you.

@KevinRansom
Copy link
Member

I think they may be related:

open namespaces or file ordering perhaps?

2018-10-01T11:17:41.1413914Z "D:\a\1\s\fcs\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" (Build target) (10:3) ->
2018-10-01T11:17:41.1414027Z   D:\a\1\s\src\absil\illib.fs(1136,48): error FS0039: The field, constructor or member 'TryGetValue' is not defined. [D:\a\1\s\fcs\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj]
2018-10-01T11:17:41.1414088Z   D:\a\1\s\src\absil\illib.fs(1150,45): error FS0039: The field, constructor or member 'TryGetValue' is not defined. [D:\a\1\s\fcs\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj]
2018-10-01T11:17:41.1414163Z   D:\a\1\s\src\absil\illib.fs(1170,47): error FS0039: The field, constructor or member 'TryGetValue' is not defined. [D:\a\1\s\fcs\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj]
2018-10-01T11:17:41.1414218Z   D:\a\1\s\src\absil\illib.fs(1176,39): error FS0039: The field, constructor or member 'TryGetValue' is not defined. [D:\a\1\s\fcs\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj]

@forki
Copy link
Contributor Author

forki commented Oct 1, 2018

ok let me check

@forki
Copy link
Contributor Author

forki commented Oct 1, 2018

@KevinRansom it looks like FCS is using outdated fsharp.core.

@KevinRansom
Copy link
Member

@forki, I really think that is "By design" .... we are going to have to wait for @dsyme to determine whether he wants to move FCS upto the latest FSharp.Core.

Kevin

@TIHan
Copy link
Contributor

TIHan commented Oct 1, 2018

Can we get some perf numbers on this change?

@KevinRansom
Copy link
Member

I imagine the perf improvements are going to be negligable. My intuition is that there will be indeed be fewer allocations, but not nearly enough to notice.

It is however a decent enough refactoring, I am fairly confident that if TryGetValue had existed when the code was originaly written, it would have been written this way. My sole concern, is having to push fcs up to FSharp.Core 4.5.

Kevin

@forki
Copy link
Contributor Author

forki commented Oct 1, 2018 via email

@KevinRansom
Copy link
Member

@forki,

Thanks for this.

@KevinRansom KevinRansom merged commit acbca82 into dotnet:master Oct 2, 2018
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.

3 participants