FixedEffects / FixedEffectModels.jl

Fast Estimation of Linear Models with IV and High Dimensional Categorical Variables
Other
225 stars 46 forks source link

Optimize drop_singletons!() #260

Closed droodman closed 7 months ago

droodman commented 7 months ago

This PR tweaks drop_singletons!() for speed, mainly by:

This is my 2nd try at this PR; I removed my Manifest.toml.

On the last example in benchmark.jl, on my late-model Windows laptop with 6 performance cores and Julia's nthreads=6, I'm getting run times of about 1.4s instead of 1.45s with this change (using @btime for timings).

matthieugomez commented 7 months ago

Thanks. I will merge it but I will remove the multithreaded part — I can't believe that this accelerates anything since the computation done at each index is so small