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

Add source generator for custom transforms #5762

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Apr 28, 2023

Prereqs:

Continuing on with the efforts to remove reflection from our codebase.

This is a WIP PR, which works but has a few things to clean up/fix (interface support and tests). I'm making this PR ahead of time (pun intended) for if there are any opinions to be had.

Code-gen can be previewed here:

Before:

Method Mean Error StdDev Allocated
UpdateTransformsWithNonePresent 4.884 us 0.0110 us 0.0103 us -
UpdateTransformsWithManyPresent 366.357 us 0.7482 us 0.5842 us -

After:

Method Mean Error StdDev Allocated
UpdateTransformsWithNonePresent 7.063 us 0.0227 us 0.0212 us -
UpdateTransformsWithManyPresent 303.062 us 0.7666 us 0.7171 us -

Before:

Method Mean Error StdDev Gen 0 Allocated
CreateSingleBlank 9.897 ns 0.1502 ns 0.1254 ns 0.0011 96 B
CreateSequenceThenClearAfter 5,834.537 ns 70.3694 ns 65.8235 ns 0.0534 4,688 B
Expiry 31,483.607 ns 611.2051 ns 541.8174 ns - 1,208 B
CreateSequenceWithDefaultEasing 1,691.055 ns 33.5365 ns 34.4395 ns 0.0134 1,200 B
ApplySequenceWithDefaultEasing 501.340 ns 8.3260 ns 7.7882 ns 0.0029 272 B
CreateSequenceWithValueEasing 1,648.158 ns 21.6247 ns 20.2277 ns 0.0134 1,200 B
ApplySequenceWithValueEasing 482.865 ns 9.1271 ns 8.9640 ns 0.0029 272 B
CreateSequenceWithReferenceEasing 1,617.588 ns 31.4736 ns 36.2450 ns 0.0134 1,272 B
ApplySequenceWithReferenceEasing 494.782 ns 9.5572 ns 9.3864 ns 0.0029 296 B

After:

Method Mean Error StdDev Gen 0 Allocated
CreateSingleBlank 10.05 ns 0.149 ns 0.117 ns 0.0011 96 B
CreateSequenceThenClearAfter 5,002.43 ns 93.678 ns 87.626 ns 0.0534 4,776 B
Expiry 31,206.24 ns 370.593 ns 346.653 ns - 1,232 B
CreateSequenceWithDefaultEasing 1,424.96 ns 23.495 ns 21.977 ns 0.0134 1,224 B
ApplySequenceWithDefaultEasing 444.87 ns 6.703 ns 5.942 ns 0.0033 280 B
CreateSequenceWithValueEasing 1,458.25 ns 28.271 ns 31.423 ns 0.0134 1,224 B
ApplySequenceWithValueEasing 440.80 ns 8.529 ns 11.956 ns 0.0033 280 B
CreateSequenceWithReferenceEasing 1,511.23 ns 10.894 ns 9.657 ns 0.0153 1,296 B
ApplySequenceWithReferenceEasing 450.94 ns 8.093 ns 7.570 ns 0.0033 304 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: On hold
Development

Successfully merging this pull request may close these issues.

2 participants