Skip to content

Instantly share code, notes, and snippets.

View Pavel-Durov's full-sized avatar
😻

Pavel Durov Pavel-Durov

😻
View GitHub Profile
$ multitime -n 10 -s 1 ~/yklua/src/lua ./harness.lua Queens 10 1000
Starting Queens benchmark ...
Queens: iterations=1 runtime: 494681us
Queens: iterations=1 runtime: 457936us
Queens: iterations=1 runtime: 461543us
Queens: iterations=1 runtime: 458264us
Queens: iterations=1 runtime: 457801us
Queens: iterations=1 runtime: 457150us
Queens: iterations=1 runtime: 458036us
Queens: iterations=1 runtime: 460640us
@Pavel-Durov
Pavel-Durov / 2025-updgrade-report-opcalls-mvir-v2-benchmarks
Created October 11, 2025 11:38
Benchmark results for opcalls in MVIR v2 - upgrade report
#!/home/pd/.pyenv/versions/3.10.13/bin/rebench -c --no-denoise rebench.conf
# Execution Start: 2025-10-10T19:24:40.241431+00:00
# Environment: {"userName":"pd","manualRun":true,"hostName":"bencher16","osType":"Linux","memory":371411361792,"denoise":{},"cpu":"Intel(R) Xeon(R) Platinum 8452Y","clockSpeed":800000000,"software":[{"name":"kernel","version":"#1 SMP PREEMPT_DYNAMIC Debian 6.12.41-1 (2025-08-12)"},{"name":"kernel-release","version":"6.12.41+deb13-amd64"},{"name":"architecture","version":"x86_64"}]}
# Source: {"repoURL":"[email protected]:ykjit/yk-benchmarks.git","branchOrTag":"main","commitId":"d443005a2188aaea3ab9b20de6eb2f380f01ce67","commitMsg":"Merge pull request #32 from vext01/commits\n\nAdd commit hashes to plots, make plots wider\n","authorName":"Laurence Tratt","committerName":"GitHub","authorEmail":"[email protected]","committerEmail":"[email protected]"}
invocation iteration value unit criterion benchmark executor suite extraArgs cores inputSize varValue tag machine runId
# benchmark: 0={"nam
@Pavel-Durov
Pavel-Durov / shrinkray_ruchards_benchmark_awfe_suite.sh
Created July 28, 2025 18:05
Shrinkray script for redusing the richards benchmark in awfe via shrinkray
#!/bin/bash
export YKD_SERIALISE_COMPILATION=1
export RUST_BACKTRACE=full
# Get the test file from shrinkray (it passes it as an argument)
TEST_FILE="$1"
if [ -z "$TEST_FILE" ]; then
echo "Error: No test file provided"
exit 1
#!/bin/bash
# Usage: shrinkray --timeout 10 --parallelism 50 --no-clang-delta shrinkray_interest.sh ./cstack.minimal.lua
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <input.lua>"
exit 1
fi
INPUT="$1"
LUA_EXEC="$SCRIPT_DIR/../src/lua"
@Pavel-Durov
Pavel-Durov / python_mp3
Created December 1, 2023 17:40
Play mp3 sound on raspberry pi
# pip install pygame
```python
import pygame
def play_mp3(file_path):
pygame.mixer.init()
pygame.mixer.music.load(file_path)
pygame.mixer.music.play()
@Pavel-Durov
Pavel-Durov / download_landcover_data.py
Created November 22, 2023 16:17
Download landcover tile to local filesystem
import os
import requests
from take_home_test_starter.config import Config
BASE_URL = "https://s3-eu-west-1.amazonaws.com/vito.landcover.global/v3.0.1/2019/"
LATITUDES = ["S40", "S20", "N00", "N20", "N40", "N60", "N80"]
@Pavel-Durov
Pavel-Durov / main.rs
Created September 28, 2023 11:29
Writing an Interpreter in Rust: Bytecode and Stack-based VM - main.rs
use std::env;
use lrlex::lrlex_mod;
use lrpar::lrpar_mod;
lrlex_mod!("coconut.l"); // brings the lexer for `coconut.l` into scope.
lrpar_mod!("coconut.y"); // brings the Parser for `coconut.y` into scope.
mod ast;
mod instruction;
@Pavel-Durov
Pavel-Durov / ast.rs
Created September 28, 2023 11:29
Writing an Interpreter in Rust: Bytecode and Stack-based VM - ast.rs
#[derive(Debug)]
pub enum Node {
Add { lhs: Box<Node>, rhs: Box<Node> },
Mul { lhs: Box<Node>, rhs: Box<Node> },
Number { value: u64 },
}
@Pavel-Durov
Pavel-Durov / instruction.rs
Created September 28, 2023 11:27
Writing an Interpreter in Rust: Bytecode and Stack-based VM - instruction.rs
#[derive(Debug, PartialEq, Clone)]
pub enum Op {
Add, // Addition operation
Mull, // Multiplication operation
Push { value: u64 }, // Load numeric value onto stack
}
#!/bin/env bash
OUT="./mp3"
mkdir ${OUT}
for f in ls ./*.flac; do
echo "processing '${f}'"
if [ -f "${f}" ]; then
CMD='ffmpeg -i "'""${f}""'" ${OUT}/"'""$(echo ${f} | sed s/.flac/.mp3/)""'"'
eval "${CMD}"
fi