-
Notifications
You must be signed in to change notification settings - Fork 789
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
Cleanup Optimizer #1519
Cleanup Optimizer #1519
Conversation
I wonder if FlatList should be removed completely!? |
| 3 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple3_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m) | ||
| 4 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple4_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m) | ||
| 5 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple5_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m) | ||
| _ -> None |
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.
This diff duplicates code - it doesn't seem right unless we know for sure it gives a measurable performance win.
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.
Yeah that idea was stupid. Reverting later
Am 05.09.2016 18:31 schrieb "Don Syme" notifications@github.com:
In src/fsharp/Optimizer.fs
#1519 (comment)
:
let vref =
match tyargs.Length with
| 2 -> Some cenv.g.generic_compare_withc_tuple2_vref
| 3 -> Some cenv.g.generic_compare_withc_tuple3_vref
| 4 -> Some cenv.g.generic_compare_withc_tuple4_vref
| 5 -> Some cenv.g.generic_compare_withc_tuple5_vref
| _ -> None
match vref with
| Some vref -> Some (DevirtualizeApplication cenv env vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m)
| None -> None
match tyargs.Length with
| 2 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple2_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m)
| 3 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple3_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m)
| 4 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple4_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m)
| 5 -> Some (DevirtualizeApplication cenv env cenv.g.generic_compare_withc_tuple5_vref ty tyargs (mkCallGetGenericComparer cenv.g m :: args) m)
| _ -> None
This diff duplicates code - it doesn't seem right unless we know for sure
it gives a measurable performance win.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/visualfsharp/pull/1519/files/28119521a9117c8dd2c8b7552576c56be57fe052..837bfc2b134d02bca14d47789145f2f5ed6ca1b3#r77542728,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNMPGJtTgy1SbVzXIejHwwLjJ4XJtks5qnEPcgaJpZM4J1Jn3
.
8e09ca3
to
ee0baed
Compare
ready for review |
Perf test of dotnet/fsharp#1519
| _ -> args |> List.map (fun _ -> UnknownValue) | ||
|
||
let args',arginfos = OptimizeExprsThenReshapeAndConsiderSplits cenv env (List.zip shapes args) | ||
| Expr.Val(vref,_,_) -> |
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.
@forki, I actually prefer the when clause on this pattern match it eliminates the duplication.
Does that make sense?
Kevin
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.
yeah but then you pattern match twice
looks good to me. |
One timeout failure on AppVeyor, unrelated to PR:
|
let binfos = minfos |> List.choose (function Choice1Of2 (_,x) -> Some x | _ -> None) | ||
let minfos = minfos |> List.choose (function Choice2Of2 x -> Some x | _ -> None) | ||
|
||
let mbinds = List<_>() |
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 prefer the original immutable code here. TMDefRec is relatively rare so I'm certain this doesn't dominate CPU perf.
(BTW if we were to use a mutable list, then please use ResizeArray
)
This looks OK Re FlatList - yes, it's just alias for List. The belief once upon-a-time was that the pervasive use of linked lists (List) instead of flatter data structures (Array, ImmutableArray etc.) was hurting. So we added an alias FlatList for certain use of Lists where it felt there would be a perf gain for switching to a flat data structure. However when switching to a flat data structure we didn't see any real perf gains. However we left FlatList in just in case we wanted to try again. So it's still unclear if we should rip it out for simplicity, or try to resurrect the experiment. I'm OK with ripping it out at this stage I suppose since the experiment has been dormant so long. |
No description provided.