Skip to content

Use Dictionary instead of Map in ValInfos - #2725

Merged
KevinRansom merged 11 commits into
dotnet:masterfrom
forki:ValInfos
Mar 31, 2017
Merged

Use Dictionary instead of Map in ValInfos#2725
KevinRansom merged 11 commits into
dotnet:masterfrom
forki:ValInfos

Conversation

@forki

Copy link
Copy Markdown
Contributor

No description provided.

Comment threadsrc/fsharp/TastOps.fs
let (ValHash t) = ht
let i = v.Stamp
if t.ContainsKey(i) then Some(t.[i]) else None
match t.TryGetValue v.Stamp with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this under some performance test?

I know this sounds stupid, but when I was looking at similar stuff and did simple testing under FSI, using similar sized dictionaries than code I was looking at, the former code actually performed better, which was kind of baffling.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes in other situations we had very good perf improvements for such things

| ValValue (vr,vinfo) -> ValValue (vr,bound (depth-1) vinfo)
| TupleValue vinfos -> TupleValue (Array.map (bound (depth-1)) vinfos)
| RecdValue (tcref,vinfos) -> RecdValue (tcref,Array.map (bound (depth-1)) vinfos)
| UnionCaseValue (ucr,vinfos) -> UnionCaseValue (ucr,Array.map (bound (depth-1)) vinfos)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since that block is changing, maybe worth to get it aligned (as it was kind of half aligned).

Comment threadsrc/fsharp/TastOps.fs Outdated

member ht.Values =
let (ValHash t) = ht
t.Values :> 'T seq

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seq<'T> please, always

@KevinRansom
KevinRansom merged commit 03a3733 into dotnet:masterMar 31, 2017
@KevinRansom

Copy link
Copy Markdown
Contributor

@forki
Thanks for taking care of this

Kevin

Sign up for freeto 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.

5 participants

@forki@KevinRansom@smoothdeveloper@dsyme@msftclas