In this recipe, we use Julia's multithreading mechanism to speed up computations of statistics over a large DataFrame.
Multithreading in Julia
Getting ready
For this recipe, you need to use the DataFrames.jl and BenchmarkTools.jl packages, which can be installed with the Julia package manager. If you need to add them then in the Julia command line, press the ] key
(v1.0) pkg> add DataFrames
(v1.0) pkg> add BenchmarkTools
This will install the DataFrames.jl and BenchmarkTools.jl packages and all their dependencies.
In this recipe, we use Julia's threading mechanism. The number of threads is controlled via the JULIA_NUM_THREADS system variable, which needs to be assigned before starting...