Skip to content

Big performance regression with allocations for .TryParseUnit #1565

Open
@carlosesquivelroisenvit

Description

Describe the bug
We have found a big difference in performance between versions 5.74 and 4.152 when doing XXX.TryParseUnit for large datasets. Version 5 allocates a lot of memory when parsing the units versus the previous version.

To Reproduce
Attaching small repro projects with BenchmarkDotNet

Expected behavior
Performance should be comparable between versions

Screenshots
Adding BenchmarkDotNet output for both versions

Version 5

Method ArraySize Mean Error StdDev Gen0 Gen1 Allocated
ConvertInchesToMm 400000 5.962 s 0.1036 s 0.1063 s 607000.0000 6000.0000 10.64 GB

Version 4

Method ArraySize Mean Error StdDev Gen0 Gen1 Gen2 Allocated
ConvertInchesToMm 400000 76.77 ms 1.474 ms 1.379 ms 16571.4286 285.7143 285.7143 296.03 MB

BenchmarkTests.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions