composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
867 stars 66 forks source link

GHC-9: FileSystem.Handle benchmark regressions #1068

Open harendra-kumar opened 3 years ago

harendra-kumar commented 3 years ago

After including the GHC rewrite rule fix:

FileSystem.Handle(Allocated)
Benchmark                                                                                    default(0)(MiB) default(1) - default(0)(%)
-------------------------------------------------------------------------------------------- --------------- --------------------------
All.FileSystem.Handle/o-1-space.copy.FH.writeWithBufferOf . FH.readWithBufferOf                       202.59                   +9477.62
All.FileSystem.Handle/o-1-space.copy.FH.write . FH.read                                               202.62                   +9476.21
All.FileSystem.Handle/o-1-space.copy/read.rawToNull                                                   202.57                   +7898.66
All.FileSystem.Handle/o-1-space.copy/read.rawToFile                                                   202.70                   +7893.67
All.FileSystem.Handle/o-1-space.reduce/read.SS.decodeUtf8 (1/10)                                       10.45                   +1139.24
harendra-kumar commented 2 years ago

Two of the benchmarks are fixed by removing NOINLINE on the benachmarks which was required earlier:

FileSystem.Handle(cpuTime)
Benchmark                                                                                    default(0)(ms) default(1) - default(0)(%) default(2) - default(0)(%)
-------------------------------------------------------------------------------------------- -------------- -------------------------- --------------------------
All.FileSystem.Handle/o-1-space.copy.FH.writeWithBufferOf . FH.readWithBufferOf                      103.67                   +1268.08                      +2.32
All.FileSystem.Handle/o-1-space.copy.FH.write . FH.read                                              104.43                   +1264.89                      +1.45
harendra-kumar commented 2 years ago

All allocation regressions are gone now, but some cpu time regressions remain:

FileSystem.Handle(cpuTime)
Benchmark                                                                                    default(0)(ms) default(1) - default(0)(%)
-------------------------------------------------------------------------------------------- -------------- --------------------------
All.FileSystem.Handle/o-1-space.reduce/read.US.lines . SS.decodeLatin1                                69.47                     +56.20
All.FileSystem.Handle/o-1-space.reduce/read/chunks.S.chunksOf 1 (1/10)                               104.65                     +48.91
All.FileSystem.Handle/o-1-space.reduce/read/chunks.S.arraysOf 1 (1/10)                               120.09                     +41.56
All.FileSystem.Handle/o-1-space.reduce/read/chunks.S.chunksOf 10                                     212.88                     +39.01
All.FileSystem.Handle/o-1-space.reduce/read/chunks.S.arraysOf 10                                     241.08                     +26.50
All.FileSystem.Handle/o-1-space.reduce/read/chunks.S.chunksOf 1000                                   101.21                     +13.06
All.FileSystem.Handle/o-1-space.reduce/read.S.drain                                                   63.47                     +12.82