Description
Reading a binlog file takes 4 seconds on .NET Desktop, but 40 seconds on Core 3.1.
Originally reported by @vatsan-madhavan in KirillOsenkov/MSBuildStructuredLog#376
Repro:
git clone https://github.com/vatsan-madhavan/MSBuildStructuredLogSummary
msbuild /r
- Download the binlog from https://1drv.ms/u/s!Ah63gfGkKca4lsl2sy71gpkpM9TCog?e=ifgsMj and save it anywhere, e.g. C:\temp\vatsan\vatsan.binlog
MSBuildBinLogSummary\bin\Debug\net472\MSBuildBinLogSummary.exe --log-file C:\temp\Vatsan\vatsan.binlog - takes 4 seconds
MSBuildBinLogSummary\bin\Debug\netcoreapp3.1\MSBuildBinLogSummary.exe --log-file C:\temp\Vatsan\vatsan.binlog - takes 40 seconds
The stack that I saw was taking all the time is ReadByte from a GzipStream, it's called millions of times (to read the binlog):
| ZLibNative.ZLibStreamHandle.Inflate Line 300
-- | --
| Inflater.Inflate Line 281
| Inflater.ReadInflateOutput Line 266
| Inflater.ReadOutput Line 122
| Inflater.InflateVerified Line 92
| Inflater.Inflate Line 55
| DeflateStream.ReadByte Line 229
| GZipStream.ReadByte Line 72
| BinaryReader.ReadBoolean Line 236
| BuildEventArgsReader.ReadTargetFinishedEventArgs Line 359
| BuildEventArgsReader.Read Line 71
| BinLogReader.Replay Line 78
| BinLogReader.Replay Line 37
| StructuredLoggerUtil..ctor Line 30
| Program.ProcessBinaryLog Line 29
| Program.Main Line 24
Configuration
Regression?
.NET Framework 4.7.2 is 4 seconds, .NET Core 3.1 is 40 seconds
Description
Reading a binlog file takes 4 seconds on .NET Desktop, but 40 seconds on Core 3.1.
Originally reported by @vatsan-madhavan in KirillOsenkov/MSBuildStructuredLog#376
Repro:
git clone https://github.com/vatsan-madhavan/MSBuildStructuredLogSummarymsbuild /rMSBuildBinLogSummary\bin\Debug\net472\MSBuildBinLogSummary.exe --log-file C:\temp\Vatsan\vatsan.binlog- takes 4 secondsMSBuildBinLogSummary\bin\Debug\netcoreapp3.1\MSBuildBinLogSummary.exe --log-file C:\temp\Vatsan\vatsan.binlog- takes 40 secondsThe stack that I saw was taking all the time is ReadByte from a GzipStream, it's called millions of times (to read the binlog):
Configuration
Regression?
.NET Framework 4.7.2 is 4 seconds, .NET Core 3.1 is 40 seconds