There's a bug in the 0.18 compiler that has a big performance regression when you have case-expressions with many branches (as I recall, 32 is where it kicks in). The bug will be fixed in 0.19, but in the meantime you can split some of the messages out into a separate union type just to split the one big case-expression into two case-expressions.
Does that make sense? Happy to elaborate if it's unclear!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.