Skip to content

Instantly share code, notes, and snippets.

View billywhizz's full-sized avatar
🤓
always be learning

Andrew Johnston billywhizz

🤓
always be learning
View GitHub Profile
@billywhizz
billywhizz / porf-sqlite.js
Created September 5, 2024 11:54
Porffor static link benchmark code
const SQLITE3_OK = 0;
const SQLITE3_ROW = 100;
const SQLITE3_OPEN_READWRITE = 0x00000002;
const SQLITE3_OPEN_CREATE = 0x00000004;
const SQLITE3_OPEN_MEMORY = 0x00000080;
const SQLITE3_OPEN_PRIVATECACHE = 0x00040000;
const SQLITE3_OPEN_NOMUTEX = 0x00008000;
function assert (condition, message) {
if (!condition) {

Building Chrome V8 on Windows

In order to be able to build v8 from scratch on Windows for x64, please follow the following steps.

These instructions were updated to work with Windows 11 Build 10.0.22621, but this should also work on WInodws 10

NOTE: While the Chrome team does provide decent documentation, there are some nuances and other additional steps that must be done for v8 to compile on Windows.

Documentation:

@billywhizz
billywhizz / vmctl
Created August 25, 2024 06:02 — forked from tgross/vmctl
Fircracker virtual machine control script
#!/usr/bin/env bash
set -euo pipefail
help() {
cat <<EOF
vmctl [COMMAND] [ARGS]
Launch firecracker VMs from configuration templates with networks
managed by CNI. VM configuration is stored in $VM_CONFIG_DIR
and network configuration is stored in $NET_CONFIG_DIR

a good example of where dynamic/jit is good is sqlite api.

with dynamic/jit, we can compile a function that is specific to the table layout and column types of the query we are running. we can eliminate code this way.

if we implement this in C or some statically compiled language then we have to use the same logic for every query, which is less efficient.

e.g.

@billywhizz
billywhizz / blake2.md
Created July 15, 2024 02:53 — forked from sooryan/blake2.md
A quick summary of blake2, a cryptographic hash function

BLAKE2

  • BLAKE2 is an improved version of the SHA-3 finalist BLAKE, and was designed by a team of experts in cryptanalysis, implementation, and cryptographic engineering; namely Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn and Christian Winnerlein.

  • BLAKE2s (the one checksum currently uses) computes a message digest that is 256 bits long, and represented as a 64-character hexadecimal number, e.g. 4264cb256d94533b6e152da59256638bc6adfda3efc5550d7607d4e6e45592fc.

Types

  • BLAKE2b (or just BLAKE2) is optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes.
@billywhizz
billywhizz / .gitignore
Last active July 8, 2024 05:00
bun typeorm crash
node_modules
*.sqlite
@billywhizz
billywhizz / README.md
Last active July 4, 2024 23:41
bun repro

intro

if we run

bun simple.mjs
node simple.mjs
@billywhizz
billywhizz / README.md
Created June 29, 2024 07:51
WiringPi Issue on Bun

setup

git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi/
./build debian

install bun 1.1.15

@billywhizz
billywhizz / .gitignore
Last active June 17, 2024 02:46
file reading benchmark for JS runtimes
openssl-3.0.12
@billywhizz
billywhizz / .config
Last active May 31, 2024 12:33
kernel boot logs for firecracker recommended 5.1 kernel versus minimal 6.1 kernel
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.1.5 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110400
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800