Skip to content

PerformanceTips

Michael Ekstrand edited this page Apr 30, 2019 · 2 revisions

LensKit has good performance, but there are some things that make it work better.

Conda

Use Conda. LensKit is optimized for Anaconda-based Python installations, and works best in that environment. It runs in vanilla Python installations, but takes advantage of Anaconda (and in particularly the MKL) to obtain exceptionally good performance.

Use TBB

LensKit works best when both LensKit and the MKL use Intel's Thread Building Blocks. If you have TBB installed, LensKit will use it automatically:

conda install tbb

MKL, however, defaults to OpenMP, even when TBB is installed. Therefore, you also need to set MKL_THREADING_LAYER=tbb for good performance:

export MKL_THREADING_LAYER=tbb

Put that in whatever shell scripts you use to launch LensKit. You can also set it in Python, put this at the top of your script before you import any LensKit or PyData packages:

import os
os.environ['MKL_THREADING_LAYER'] = 'tbb'
Clone this wiki locally