Skip to content

Question about additional type safety and performance #8763

Answered by ReubenBond
AnthonyLloyd asked this question in Q&A
Discussion options

You must be logged in to vote

@AnthonyLloyd There will be a small perf hit. I'm fairly sure the added complexity in the code generator to avoid that small perf cost is not worthwhile. You can craft your own codecs if you really want to, eg by copying DoubleCodec and modifying it to use Price instead. I don't think this is worthwhile, though, and if you ever add additional fields, you'd need to adjust your codec to handle that by checking the wire type and switching behavior.

As for grain keys, they should be UTF8 encoded strings so that they can be displayed in logs, traces, metrics, error messages, etc. You can create your own using GrainId.Create(type, key) and use the IGrainFactory overload which accepts a GrainId.

H…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AnthonyLloyd
Comment options

Answer selected by AnthonyLloyd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants