Skip to content

Instantly share code, notes, and snippets.

View UBarney's full-sized avatar

UBarney

  • beijing
  • 12:43 (UTC +08:00)
View GitHub Profile
#!/usr/bin/env python3
import subprocess
import sys
import os
import time
import threading
from typing import List, Tuple
def get_peak_memory_usage(cmd: List[str]) -> Tuple[float, int]:
@UBarney
UBarney / bench.rs
Created June 22, 2025 09:12
bench.rs
use std::cmp::min;
use std::sync::Arc;
use std::time::Duration;
use arrow::array::{
UInt32Array, UInt64Array,
};
use arrow::datatypes::Schema;
use arrow_schema::{DataType, Field};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
#!/usr/bin/env python3
# example usage:
# python3 get_mem_usage.py ./target/release/dfbench nlj
# ....
# Query Time (ms) Peak RSS
# --------------------------------
# 1 230 83.3 MB
# 2 310 362.1 MB
# 3 550 1.4 GB