#[cfg(feature = "std")]
pub use std::time::Instant;
#[cfg(not(feature = "std"))]
#[derive(Clone, Copy, Debug)]
pub struct Instant;
#[cfg(not(feature = "std"))]
impl Instant {
pub fn now() -> Self {
Self
}
pub fn elapsed(&self) -> core::time::Duration {
core::time::Duration::from_secs(0)
}
}
#[inline(always)]
pub fn compute_split_vars(num_vars: usize, num_queries: usize) -> usize {
if num_vars == 0 {
return 0;
}
let factor = (num_queries * 8).max(1);
let optimal_c = (num_vars + factor.ilog2() as usize) / 2;
optimal_c.clamp(1, num_vars.max(1))
}