Import multiple versions of one module / package for benchmarking

I am working on a package, this package using BinDeps to pull out some C source code and compile some executables.

My julia module then basically just provides ccalls for these functions.

Now there are about 5 different options for how you can compile the C source, with various different optimizations. And go with them various other changes that are triggered by a constant, which is written in deps.jl , which is output by BinDeps.

So, I would like to import each of the different collections of my package into different modules, so I can compare them using BenchmarkTools.jl .

I am currently planning to create a script that generates 5 different versions of my module, copying it and changing its name, as well as using other deps.jl files to link to different compiled shared libraries.

And then (assuming I renamed them numerically):

 using BenchmarkTools import MyMod_1 import MyMod_2 import MyMod_3 import MyMod_4 import MyMod_5 @show @benchmark MyMod_1.foo() @show @benchmark MyMod_2.foo() @show @benchmark MyMod_3.foo() @show @benchmark MyMod_4.foo() @show @benchmark MyMod_5.foo() 

I am currently writing scripts for copying and renaming modules. It's a little scary, and it seems a little fragile.

But is there a better way?

+1
source share

All Articles