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

Serializers are being generated for unneeded types #3771

Closed
dVakulen opened this issue Dec 8, 2017 · 8 comments
Closed

Serializers are being generated for unneeded types #3771

dVakulen opened this issue Dec 8, 2017 · 8 comments
Assignees
Milestone

Comments

@dVakulen
Copy link
Contributor

dVakulen commented Dec 8, 2017

Such as OutboundMessageQueue, OrleansTaskScheduler, etc:

image

It results in 20k+ LOC generated files, slowing the build and IDE.

(using latest master branch (0aa92f3))

@sergeybykov sergeybykov added this to the Triage milestone Dec 8, 2017
@sergeybykov
Copy link
Contributor

Indeed, I see OrleansCodeGenOrleans_Runtime_Messaging_MessageCenterSerializer, OrleansCodeGenOrleans_Runtime_SocketManagerSerializer, OrleansCodeGenOrleans_Runtime_Messaging_OutboundMessageQueueSerializer and more such classes getting generated. Looks like a regression to me.

@sergeybykov sergeybykov modified the milestones: Triage, 2.0.0 Dec 8, 2017
@sergeybykov
Copy link
Contributor

I just checked that at 43efc4b this wasn't the case. So it's a relatively recent regression.

I think we can still release beta2 with this as it doesn't seem to break anything.

@sergeybykov
Copy link
Contributor

The regression got introduced as part of #3669.

@ReubenBond
Copy link
Member

ReubenBond commented Dec 9, 2017

My bad, I widened the search to consider all types in the target assemblies as though they were marked [Serializable]. I'll undo it if it's causing builds to be slower or build output to be significantly larger

@onionhammer
Copy link
Contributor

Why not only generate serializers for the types used by Orleans grain interface contracts?

@sergeybykov
Copy link
Contributor

@onionhammer Since Orleans is very accommodating when it comes to data types being passed (interfaces, object arguments, various collection types), it would be too restrictive to do that. We give developers a few ways to point to more types that they know could be passed over the wire.

@onionhammer
Copy link
Contributor

onionhammer commented Dec 16, 2017

It seems like those indeterminate type serializers could be generated at runtime and cached

@sergeybykov
Copy link
Contributor

In theory, yes. In practice, we ran into a number of corner cases and subtle issues (e.g. with loading of dependency types and their order) with run time generation of serializers. Because of that, in 2.0 we are making run time codegen optional and more explicit - it runs only for specified assemblies and only during silo/client build time. That seems to produce more predictable and repeatable results.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants