code generation for simscape should not be causing a slow down like this. It is often used for real-time tasks where execution timing is critical. I'm not sure what settings are required for simulink coder to work. I would try to run the model with these settings:
Simulink settings - used discrete step solver if possible, or a fixed step solver like ode3.
Simscape settings - set to fixed step in the solver configuration and check the box for fixed cost runtime.
If these settings don't help, would you be willing to share your model? Is your model accessing files or anything like that?
What are you using for your compiler?