-
Notifications
You must be signed in to change notification settings - Fork 802
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
Difference of compilation time between 13 000 "static member" and 13 000 "let binding" #13218
Comments
I took a look. Methodology:
There's a complaint about 64-bit stacks from PerfView Highly suspicious on inclusive list:
Matching entry on exclusive list:
To me this indicates an algorithmic problem where the |
So note that the two inputs are fairly different - the |
Note also a lot of exception handlers are being emitted in the initialization code, which may not be entirely obvious, because of this:
This doesn't mean the compiler perf isn't fixable, but does help to explain why the two aren't easily comparable. (This is also almost certainly not correct in any case - the initialization code will fail if ever triggered, which is unlikely to be as desired - though maybe Fable compilation ensures it never is.) |
Indeed, I didn't thought about the fact that
In Fable, using For example, this code: [<Erase>]
type mdi =
[<Import("default", "@iconify-icons/mdi/123-off")>]
static member inline _123Off : string =
jsNative
let myIcon = mdi._123Off produce import $003123_off from "@iconify-icons/mdi/123-off";
export const myIcon = $003123_off; which is what is expected from JavaScript of view. Using the exception in |
Hello,
while working on a binding for Fable I encounter a case with a huge number elements to map, around 13 000.
Depending on how I represents those elements the compilation time (when running
dotnet build
) can be really different:static member
let
I measured the timing in two ways:
Force clean
bin
andobj
foldersdotnet build
Force save
Types.fs
filedotnet build
If I don't update the
Types.fs
file, then the compilation is almost instant probably because of/thanks to cache mechanismLetBindings
Force save
Force clean
Static members
Force clean
Force save
I don't know why the first 2 times it was that slow, perhaps I had something running on my computer taking too much ressources. I left then in the timing because I didn't want to hide this situation
Repro steps
Here is a zip file containing two projects using both of the representation with 13 000 elements in them.
reproduction-fsharp-compilation-diff-method-let.zip
Expected behavior
Compilation time between
static member
orlet binding
should not be that different?As fast as possible compilation time for both representation.
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: