Skip to content

Reading compressed encrypted Stream 60x slower on Net6 than Net Framework #83909

Open
@RobSwDev

Description

@RobSwDev

Description

We're in the process of upgrading from Net Framework 4.72 to Net6.
Unfortunately, we've come across one scenario where the performance in Net6 (or Net7) is terrible compared to Net Framework - in some cases taking 50-60 times as long

I was able to hack a simple application together to reproduce something similar (Streams.zip attached). In this app, the slowdown seems to be x180 !!

Using Net 4.0.30319.42000
Writing 500000 lines took 00:00:00.8609345
Reader 300000 lines took 00:00:00.1417714
Using Net 6.0.15
Writing 500000 lines took 00:00:00.4266431
Reader 300000 lines took 00:00:25.5608638
Using Net 7.0.4
Writing 500000 lines took 00:00:00.4134467
Reader 300000 lines took 00:00:23.6623887

Streams.zip

Reproduction Steps

Compile and run the attached project, both under Net472, Net6 and Net7.

Expected behavior

Performance on Net6 should be better than, or at least comparable to, that on Net472. That's what we have seen elsewhere.

Actual behavior

Using Net 4.0.30319.42000
Writing 500000 lines took 00:00:00.8609345
Reader 300000 lines took 00:00:00.1417714
Using Net 6.0.15
Writing 500000 lines took 00:00:00.4266431
Reader 300000 lines took 00:00:25.5608638
Using Net 7.0.4
Writing 500000 lines took 00:00:00.4134467
Reader 300000 lines took 00:00:23.6623887

Regression?

Huge performance regression in Net6/7 compared to NetFramework 4.72

Known Workarounds

None known. I would be very interested to learn any..

Configuration

Windows 10 22H2 19045.2728
Comparing different versions of Net:
Net472 vs Net 6.0.15 vs Net 7.0.4
x64 configuration

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions