computer: snapshot

This commit is contained in:
nym21
2025-12-28 14:57:25 +01:00
parent e77d338357
commit f08ac7f916
81 changed files with 1394 additions and 930 deletions

View File

@@ -1,5 +1,6 @@
use std::{env, path::Path, thread, time::Instant};
use brk_alloc::Mimalloc;
use brk_bencher::Bencher;
use brk_computer::Computer;
use brk_error::Result;
@@ -9,12 +10,8 @@ use brk_iterator::Blocks;
use brk_reader::Reader;
use brk_rpc::{Auth, Client};
use log::{debug, info};
use mimalloc::MiMalloc;
use vecdb::Exit;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
pub fn main() -> Result<()> {
// Can't increase main thread's stack size, thus we need to use another thread
thread::Builder::new()
@@ -65,6 +62,8 @@ fn run() -> Result<()> {
let starting_indexes = indexer.index(&blocks, &client, &exit)?;
info!("Done in {:?}", i.elapsed());
Mimalloc::collect_if_wasted_above(500);
let i = Instant::now();
computer.compute(&indexer, starting_indexes, &reader, &exit)?;
info!("Done in {:?}", i.elapsed());