Skip to content

Reduce allocations by favoring TryGetValue over TryFind#5715

Merged
KevinRansom merged 8 commits intodotnet:masterfrom
forki:tgv2
Oct 2, 2018
Merged

Reduce allocations by favoring TryGetValue over TryFind#5715
KevinRansom merged 8 commits intodotnet:masterfrom
forki:tgv2

Conversation

@forki
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

forki commented Oct 1, 2018

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

@KevinRansom
Copy link
Copy Markdown
Contributor

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

@KevinRansom
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

forki commented Oct 1, 2018

ok let me check

@forki
Copy link
Copy Markdown
Contributor Author

forki commented Oct 1, 2018

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

@KevinRansom
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

TIHan commented Oct 1, 2018

Can we get some perf numbers on this change?

@KevinRansom
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

forki commented Oct 1, 2018 via email

@KevinRansom
Copy link
Copy Markdown
Contributor

@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