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

Seal types not suitable for extending #611

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Dec 8, 2023

CLR can make better decisions when it knows there's no worry to do virtual calls to ensure that possible overridden method would be correctly called. Types really don't have extension points via inheritance.

Fluid.Benchmarks.FluidBenchmarks

Diff Method Mean Error Allocated
Old Parse 3.193 μs 0.0312 μs 2.68 KB
New 3.152 μs (-1%) 0.0307 μs 2.68 KB (0%)
Old ParseBig 16.892 μs 0.2980 μs 11.61 KB
New 16.840 μs (0%) 0.2747 μs 11.61 KB (0%)
Old Render 133.681 μs 2.5941 μs 95.86 KB
New 130.399 μs (-2%) 1.4315 μs 95.86 KB (0%)
Old ParseAndRender 135.980 μs 1.5126 μs 99.01 KB
New 135.876 μs (0%) 2.0597 μs 99.01 KB (0%)

@sebastienros
Copy link
Owner

I fear that it will break someone. But let's try and see people complain, the current version being quite stable they shouldn't need to upgrade and won't be blocked.

@sebastienros sebastienros merged commit 89706a0 into sebastienros:main Dec 8, 2023
1 check passed
@lahma lahma deleted the seal-types branch December 8, 2023 18:31
@lahma
Copy link
Collaborator Author

lahma commented Dec 8, 2023

This was my thinking too, let's break it and unseal when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants