I’m using graphql PPX with wordpress data that’s generating a polymorphic variant which produces about 25 branches in a switch statement.
With the switch statement enabled, compilation takes about 20s with
rescript build -w, changing only the one file.
If I only include one catchall branch in the switch, eg
| _ => React.null it compiles in 65ms
Adding one branch after the other bumps it to 250ms, 290ms, 407ms, 595ms and so on, and by the time I’ve added all 25 branches I’m over 20s.
Any ideas on how I might prevent this?