diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md index b30a501d979..85f37d1af06 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -166,6 +166,9 @@ * Support for the `` XML documentation tag: at compile time, documentation is copied from an external XML file selected by an XPath query and emitted into the generated documentation file. `` remains unsupported. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19186](https://github.com/dotnet/fsharp/pull/19186)) * Expand `` at tooling time. In IDE tooltips, completion, and signature help, documentation is inherited from base classes, interfaces, overridden members, and constructors (matched by parameter signature). The FCS Symbols API (`FSharpSymbol.XmlDoc`) additionally resolves explicit `cref` targets, but does not expand constructor inheritance. The compiler emits the tag verbatim into generated XML documentation files, matching C#; `` is not implemented. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19188](https://github.com/dotnet/fsharp/pull/19188)) * Add symbol and type highlighting to F# diagnostics ([PR #20097](https://github.com/dotnet/fsharp/pull/20097)) +* IL: add `ILPreNamespace`, make `ILPreTypeDef` creation lazy ([PR #20092](https://github.com/dotnet/fsharp/pull/20092)) +* IL: use empty tables for members when possible ([PR #20249](https://github.com/dotnet/fsharp/pull/20249)) +* IL: size the string heap cache to grow and remove the type name intern table ### Improved diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index d0eae0bc82f..8f44a5203e0 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1109,7 +1109,6 @@ type ILMetadataReader = blobsStreamPhysicalLoc: int32 blobsStreamSize: int32 readUserStringHeap: int32 -> string - memoizeString: string -> string readStringHeap: int32 -> string readBlobHeap: int32 -> byte[] guidsStreamPhysicalLoc: int32 @@ -2081,7 +2080,7 @@ and readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) = match nspace with | None -> name - | Some ns -> ctxt.memoizeString (ns + "." + name) + | Some ns -> ns + "." + name and seekReadTypeDefRowExtents (ctxt: ILMetadataReader) _info (idx: int) = if idx >= ctxt.getNumRows TableNames.TypeDef then @@ -4246,7 +4245,7 @@ let openMetadataReader let firstStreamLength = seekReadInt32 mdv (streamHeadersStart + 4) firstStreamOffset, firstStreamLength - let stringsStreamPhysicalLoc, stringsStreamSize = + let stringsStreamPhysicalLoc, _stringsStreamSize = findStream [| 0x23; 0x53; 0x74; 0x72; 0x69; 0x6e; 0x67; 0x73 |] (* #Strings *) let userStringsStreamPhysicalLoc, userStringsStreamSize = @@ -4520,8 +4519,9 @@ let openMetadataReader let cacheUserStringHeap = mkCacheGeneric reduceMemoryUsage inbase "UserStringHeap" (userStringsStreamSize / 20 + 1) // nb. Lots and lots of cache hits on this cache, hence never optimize cache away - let cacheStringHeap = - mkCacheGeneric false inbase "string heap" (stringsStreamSize / 50 + 1) + // Sized to grow rather than from the stream length: only a small fraction of a #Strings heap is ever + // read, so sizing from it left the table around 11% full, one nearly-empty table per reference. + let cacheStringHeap = mkCacheGeneric false inbase "string heap" 0 let cacheBlobHeap = mkCacheGeneric reduceMemoryUsage inbase "blob heap" (blobsStreamSize / 50 + 1) @@ -4565,7 +4565,6 @@ let openMetadataReader stringsStreamPhysicalLoc = stringsStreamPhysicalLoc blobsStreamPhysicalLoc = blobsStreamPhysicalLoc blobsStreamSize = blobsStreamSize - memoizeString = Tables.memoize id readUserStringHeap = cacheUserStringHeap (readUserStringHeapUncached ctxtH) readStringHeap = cacheStringHeap (readStringHeapUncached ctxtH) readBlobHeap = cacheBlobHeap (readBlobHeapUncached ctxtH)