-
Notifications
You must be signed in to change notification settings - Fork 123
make Internal.Utilities.Text.Lexing.Position a struct #415
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
Conversation
|
This is potentially a good change. A couple of things
Thanks |
|
Hi, Don. How exactly I can run parsing on a file? If I use |
|
I guess you could generate a sequence of textually different files? |
|
I've tested it on all *.fs files in src/fsharp dir https://github.com/vasily-kirichenko/FSharp.Compiler.Service/blob/parser-perf/tests/ConsoleApplication1/Program.fs Results: before - 6.7 s, after - 7.03 s, which is roughly 5% digression :( Memory traffic (all objects created during the parsing), before: after: Now |
make suffixExists and tokenBalancesHeadContext top-level functions to eliminate heap allocations
|
I replaced a couple of top allocated |
|
@dsyme Have you had a second look at this PR? It seems like a good enhancement to make. |
@vasily-kirichenko Is this what's currently in the PR? Thx. |
|
(I'll reopen since there does seem to be value here, once we confirm the tradeoffs) |
|
@dsyme yes. |
make Internal.Utilities.Text.Lexing.Position a struct
|
@vasily-kirichenko Would it be possible for you to submit this to Microsoft\visualfsharp as well please? I don't mind accepting it here first but ideally we should get it submitted there too. |
|
@dsyme done dotnet/fsharp#664 |
Heap allocation before:


After: