Bit of a random question, but I was reading through the :gen_server
/:gen
implementation and I noticed that the tag allocated for a call is an improper list of [:alias | reference]
. I thought that was pretty weird as I would have expected a tuple {:alias, reference}
or similar.
I don’t think I’ve ever seen an improper list used for anything in Elixir, so I was wondering what the reasoning was. After some searching it sounds like that representation saves a byte over the tuple, so I guess that’s probably the reason (that code is a pretty hot path).
Does anyone know any more about this? Does this come up anywhere else in the codebase(s)?
Also, there is an optimization for matching a message with a reference. Does anyone know if this has any interaction with that?