-
Notifications
You must be signed in to change notification settings - Fork 772
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
Optimize completion #5066
Optimize completion #5066
Conversation
do not generalize suppressed types twice
@dotnet-bot test this please |
@cartermp it's not compilable at the moment. |
remove cancellation from CompletionProvider
Never mind.
Vasily Kirichenko <notifications@github.com> schrieb am Sa., 2. Juni 2018,
09:11:
… ***@***.**** commented on this pull request.
------------------------------
In src/fsharp/service/ServiceAssemblyContent.fs
<#5066 (comment)>
:
> @@ -186,14 +187,31 @@ type IAssemblyContentCache =
module AssemblyContentProvider =
open System.IO
- let private createEntity ns (parent: Parent) (entity: FSharpEntity) =
+ let unresolvedSymbol (topRequireQualifiedAccessParent: Idents option) (cleanedIdents: Idents) (fullName: string) =
+ let getNamespace (idents: Idents) =
+ if idents.Length > 1 then Some idents.[..idents.Length - 2] else None
+
+ let ns =
+ topRequireQualifiedAccessParent
+ |> Option.bind getNamespace
+ |> Option.orElseWith (fun () -> getNamespace cleanedIdents)
+ |> Option.defaultValue [||]
What do you mean? [||] is a singleton, no allocations here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5066 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNCVeV8NhG-DO3ObG2xKzF418Qipqks5t4jqUgaJpZM4UWqUx>
.
|
@forki @smoothdeveloper all done, thanks. |
This is great work! |
@dsyme Do I understand right that we still cannot use struct tuples in FSharp.Compiler.Private project? |
You can if you really need to but can cause some problems with packaging various releases and the Fable build of the compiler - but it's normally clearer to introduce a named struct |
@vasily-kirichenko Nice catch. We should put that change into F# 4.5. Could you isolate that 3-line change out into a separate PR? |
OK, replacing tuples with structs needs benchmarking anyway. |
Re Array.Empty, I meant:
and so on. i.e. type-indexed by automagic of .NET generics. .NET 4.something actually has
which is a singleton. Hwoever it's only available since .NET 4.6 and FSharp.Core needs to run on .NET 4.5. We could use it for .NET Standard though |
@dsyme I've added the array empty singleton. |
It turns out that open System
open BenchmarkDotNet
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running
type Test() =
[<Benchmark(Baseline = true)>]
member __.Sprintf() = sprintf "%06d" 123456
[<Benchmark>]
member __.Format() = (123456).ToString("D6")
[<EntryPoint>]
let main _ =
BenchmarkRunner.Run<Test>() |> ignore
0
|
This reverts commit c4ef4ad.
@dotnet-bot test Ubuntu16.04 Release_default Build please |
# Conflicts: # src/fsharp/FSharp.Core/prim-types.fs
@dsyme can you re-review this? We have until Tuesday afternoon, then we will make the cutoff for dev15.8. I'd love to get this in for that. |
* optimize completion * cache UnresolvedSymbol do not generalize suppressed types twice * more cancellable completion provider * don't call isAttribute twice remove cancellation from CompletionProvider * optimize IsExplicitlySuppressed, traverseMemberFunctionAndValues * cache ILTypeDef.CustomAttrs * optimize IsExplicitlySuppressed * avoid using Lazy to store custom attributes in ILTypeDef * CompletionProvider item's cache: replace dictionary with array * provide fast generic comparer for bool values * make getKindPriority inline * more defensive unresolvedSymbol * empty array singleton table * faster IsOperatorName * optimize CompletionProvider * Revert "empty array singleton table" This reverts commit c4ef4ad.
First invocation
Before
After
Second invocation
Before
After