I have the code below to deal with panel data (there are quite a bit missing variables in my dataset)

Code:
 
 did2s depvar [if] [in] [weight], first_stage(varlist) second_stage(varlist) treatment(varname) cluster(varname)
When I start running this code, Stata takes me a long time compare to normal reghdfe code. I am wondering how to optimize the code that I can run it in STATA better.