Skip to content

#18875 degraded typecheck performance #18925

@majocha

Description

@majocha

It seems #18875 unfortunately makes type check slow.

To get a clear picture I prepared two Bootstrap folders, one from current head, one from the commit just before #18875, which is 71167fb:

git checkout 71167fb
dotnet publish .\proto.proj -c Proto
mv .\artifacts\Bootstrap .\artifacts\Bootstrap-before

and so on...

Then I built current main of net10.0 FCS and looked at the times

dotnet build .\src\Compiler\ -c Release -f net10.0 -m:1 --no-incremental -bl
.\msbuild.binlog

It looks like this:

parallelism with FSHARP_EXPERIMENTAL_FEATURES

before #18875 (at commit 71167fb)
--------------------------------------------------------------------------------------------------------
|Phase name                          |Elapsed |Duration| WS(MB)|  GC0  |  GC1  |  GC2  |Handles|Threads|
|------------------------------------|--------|--------|-------|-------|-------|-------|-------|-------|
|Typecheck                           |  8.6085|  7.2778|   1574|     54|     23|      4|   1014|     83|
|Write .NET Binary                   | 32.8915|  3.7386|   2378|      5|      3|      2|    517|     52|

head, parallelism with FSHARP_EXPERIMENTAL_FEATURES
--------------------------------------------------------------------------------------------------------
|Phase name                          |Elapsed |Duration| WS(MB)|  GC0  |  GC1  |  GC2  |Handles|Threads|
|------------------------------------|--------|--------|-------|-------|-------|-------|-------|-------|
|Typecheck                           | 20.3543| 18.5384|   1286|    939|    105|      3|    624|     71|
|Write .NET Binary                   | 39.3354|  3.4358|   2726|      5|      2|      1|    514|     49|


and with no parallelism:

before #18875
--------------------------------------------------------------------------------------------------------
|Phase name                          |Elapsed |Duration| WS(MB)|  GC0  |  GC1  |  GC2  |Handles|Threads|
|------------------------------------|--------|--------|-------|-------|-------|-------|-------|-------|
|Typecheck                           | 25.0360| 23.1925|   1548|     53|     20|      3|    769|     51|
|Write .NET Binary                   | 44.8652|  3.2965|   2497|      5|      2|      1|    437|     52|

head
--------------------------------------------------------------------------------------------------------
|Phase name                          |Elapsed |Duration| WS(MB)|  GC0  |  GC1  |  GC2  |Handles|Threads|
|------------------------------------|--------|--------|-------|-------|-------|-------|-------|-------|
|Typecheck                           | 43.4828| 42.1082|   1268|    840|     55|      5|    410|     48|
|Write .NET Binary                   | 62.6051|  3.4594|   2550|      5|      2|      1|    424|     49|

So this is a substantial regression; Typecheck phase is twice as slow or more.

Most probably the reason is that my code in TypeHashing.fs is not optimized. The previous hybrid referential equality was way faster.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions