mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-28 01:01:00 +00:00
Optimize things
This commit is contained in:
25
benches/search.rs
Normal file
25
benches/search.rs
Normal file
@ -0,0 +1,25 @@
|
||||
#![feature(test)]
|
||||
extern crate test;
|
||||
|
||||
use heed::EnvOpenOptions;
|
||||
use mega_mini_indexer::Index;
|
||||
|
||||
#[bench]
|
||||
fn search_minogue_kylie_live(b: &mut test::Bencher) {
|
||||
let database = "books-4cpu.mmdb";
|
||||
let query = "minogue kylie live";
|
||||
|
||||
std::fs::create_dir_all(database).unwrap();
|
||||
let env = EnvOpenOptions::new()
|
||||
.map_size(100 * 1024 * 1024 * 1024) // 100 GB
|
||||
.max_readers(10)
|
||||
.max_dbs(5)
|
||||
.open(database).unwrap();
|
||||
|
||||
let index = Index::new(&env).unwrap();
|
||||
|
||||
b.iter(|| {
|
||||
let rtxn = env.read_txn().unwrap();
|
||||
let _documents_ids = index.search(&rtxn, query).unwrap();
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user