#![cfg(not(debug_assertions))]
#![allow(unsafe_code)]
#![allow(
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_precision_loss,
clippy::cast_sign_loss,
clippy::doc_markdown,
clippy::useless_conversion,
clippy::similar_names,
clippy::uninlined_format_args,
clippy::unreadable_literal
)]
use std::sync::{Mutex, MutexGuard, OnceLock};
use std::thread;
use std::time::Duration;
fn perf_lock() -> MutexGuard<'static, ()> {
static L: OnceLock<Mutex<()>> = OnceLock::new();
let guard = L
.get_or_init(Mutex::default)
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);
thread::sleep(Duration::from_millis(500));
guard
}
use std::alloc::{GlobalAlloc, Layout, System};
use std::sync::atomic::{AtomicUsize, Ordering};
static LIVE_BYTES: AtomicUsize = AtomicUsize::new(0);
static PEAK_BYTES: AtomicUsize = AtomicUsize::new(0);
static ALLOC_CALLS: AtomicUsize = AtomicUsize::new(0);
struct PeakTracker;
unsafe impl GlobalAlloc for PeakTracker {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
let p = unsafe { System.alloc(layout) };
if !p.is_null() {
ALLOC_CALLS.fetch_add(1, Ordering::Relaxed);
let live = LIVE_BYTES.fetch_add(layout.size(), Ordering::Relaxed) + layout.size();
PEAK_BYTES.fetch_max(live, Ordering::Relaxed);
}
p
}
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
LIVE_BYTES.fetch_sub(layout.size(), Ordering::Relaxed);
unsafe { System.dealloc(ptr, layout) }
}
}
#[global_allocator]
static PEAK_TRACKING_ALLOC: PeakTracker = PeakTracker;
mod content_worker_top_n;
mod count_unseen;
mod join_reorder;
mod mailrs_prod_cascade_100k;
mod never_die;
mod ordered_agg;
mod plan_cache;
mod proj_borrow;
mod resident;
mod round26_mem;
mod select_where;
mod sentori_epic7_throughput;
mod stages_knn;