meilisearch icon indicating copy to clipboard operation
meilisearch copied to clipboard

Indexing unit benchmarks

Open ManyTheFish opened this issue 3 years ago • 2 comments

Summary

Add a unit benchmark for each extractor in the indexer, the goal is:

  • during the development phase, seeing fastly and efficiently the impact of local optimization
  • during the performance-regression investigation phase, helping to find local regressions

Checklist

  • extractors
  • prefix db

ManyTheFish avatar Jul 12 '22 08:07 ManyTheFish

I started looking into this issue and it’s not as easy as I thought;

irevoire avatar Jul 12 '22 15:07 irevoire

I implemented a first version of a unit benchmark using the nightly stdlib solution since it’s the only one that allows unit benchmarks. You can look at this commit; https://github.com/meilisearch/milli/pull/581/commits/10b42cc0d79f7eb975701a19e3d918e6f400ed3f Basically, we need to import select-rustc; once this is done, we can #[cfg(feature = "nightly")], and we need to do this for everything related to the benchmarks. To simplify the code a little bit, I created a module in the test module where I threw my benchmarks.

irevoire avatar Jul 14 '22 09:07 irevoire