Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DUCE.CopyBytes #10377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Jan 31, 2025

Description

Removes DUCE.CopyBytes that was used to set struct fields. It was probably used in the past to improve performance but since then the JIT has improved and is faster than custom memcopy, thanks in part to SIMD.

LinearGradientBrush and RadialGradientBrush were the only 2 of many DUCE resources to use this method.

Benchmark results (Copying 5 double to a struct)
Method Mean Error StdDev Ratio Code Size
CopyBytes 6.8878 ns 0.0178 ns 0.0158 ns 1.00 150 B
JIT 0.8358 ns 0.0050 ns 0.0044 ns 0.12 46 B

Customer Impact

Slightly better performance.

Regression

No.

Testing

Local testing.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@ThomasGoulet73 ThomasGoulet73 requested review from a team as code owners January 31, 2025 03:52
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Jan 31, 2025
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 PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant