to do the experiment, you need to add some lines to the repo:
// clash_lib/src/lib.rs
#[cfg(test)]
#[global_allocator]
static ALLOC: dhat::Alloc = dhat::Alloc;
use std::sync::Arc; | |
use std::thread; | |
use std::time::Instant; | |
fn main() { | |
// Number of iterations for our test | |
const ITERATIONS: u64 = 100_000_000; | |
println!("Running cache false sharing experiment..."); | |
println!("Iterations per thread: {}", ITERATIONS); |
use snafu::{Location, ResultExt, Snafu}; | |
use stack_error::ext::StackError; | |
use stack_error_macro::stack_trace_debug; | |
#[derive(Snafu)] | |
#[snafu(visibility(pub))] | |
#[stack_trace_debug] | |
pub enum GlobalGlobalError { | |
#[snafu(display("Package error: {source}"))] | |
GlobalError { |
#![feature(error_generic_member_access)] | |
#[derive(thiserror::Error, Debug)] | |
pub enum RustError { | |
#[error("Java error: {source}")] | |
Java { | |
#[from] | |
#[backtrace] | |
source: JavaError, | |
}, |
#! /bin/bash | |
red='\033[0;31m' | |
yellow='\033[1;33m' | |
blue='\033[0;34m' | |
green='\033[0;32m' | |
NC='\033[0m' # No Color | |
function echo_color() | |
{ |