I have two codes below

Code:
reg dep_var indep_var i.unit i.period
and

Code:
reghdfe dep_var indep_var, a(unit period)
I saw that it takes only 5 seconds to run the reghdfe but it takes more than 10 minutes to run reg command above.
Can I ask why this phenomenon happens and how to deal with it (reducing the time running reg command)?

Thanks in advance and warm regards.