Skip to content

Optimize FigureLength struct conversion to string, reduce allocations#9888

Open
h3xds1nz wants to merge 5 commits intodotnet:mainfrom
h3xds1nz:figurelength-speedup
Open

Optimize FigureLength struct conversion to string, reduce allocations#9888
h3xds1nz wants to merge 5 commits intodotnet:mainfrom
h3xds1nz:figurelength-speedup

Conversation

@h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Oct 3, 2024

Description

Optimizes conversion of FigureLength to string. Simplifies Can* methods, adds some documentation.

Simple ToString conversion

Method figureLength Mean [ns] Error [ns] StdDev [ns] Gen0 Code Size [B] Allocated [B]
Original 999 102.3501 ns 2.0471 ns 3.0640 ns 0.0048 4,171 B 80 B
PR__EDIT 999 76.9590 ns 1.3950 ns 1.2367 ns 0.0029 957 B 48 B
yield return new FigureLength(999.0, FigureUnitType.Column);

Customer Impact

Improved performance, decreased allocations.

Regression

No.

Testing

Local build, conversion tests.

Risk

Low; do note that #9887 should be taken first imho.

Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution A label for all community Contributions Included in test pass PR metadata: Label to tag PRs, to facilitate with triage Status:Completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants