-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbenchmarks.do
30 lines (25 loc) · 1.03 KB
/
benchmarks.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
* Derived from https://github.com/FixedEffects/FixedEffectModels.jl/blob/master/benchmark/benchmark.md
scalar N = 10000000
scalar K = 100
set obs `=N'
gen id1 = runiformint(1, N/K)
gen id2 = runiformint(1, K)
drawnorm x1 x2
gen double y = 3 * x1 + 2 * x2 + sin(id1) + cos(id2) + runiform()
set rmsg on
set processors 1
qui areg y x1 x2, a(id1) cluster(id1)
qui reghdfe y x1 x2, a(id1) cluster(id1) dof(none)
qui reghdfejl y x1 x2, a(id1) cluster(id1)
qui reghdfejl y x1 x2, a(id1) cluster(id1) gpu
qui reghdfe y x1 x2, a(id1 id2) cluster(id1 id2) dof(none)
qui reghdfejl y x1 x2, a(id1 id2) cluster(id1 id2)
qui reghdfejl y x1 x2, a(id1 id2) cluster(id1 id2) gpu
set processors 6 // requires Stata/MP
qui areg y x1 x2, a(id1) cluster(id1)
qui reghdfe y x1 x2, a(id1) cluster(id1) dof(none)
qui reghdfejl y x1 x2, a(id1) cluster(id1)
qui reghdfejl y x1 x2, a(id1) cluster(id1) gpu
qui reghdfe y x1 x2, a(id1 id2) cluster(id1 id2) dof(none)
qui reghdfejl y x1 x2, a(id1 id2) cluster(id1 id2)
qui reghdfejl y x1 x2, a(id1 id2) cluster(id1 id2) gpu