Skip to content

Instantly share code, notes, and snippets.

View nazarhussain's full-sized avatar
🎯
Focusing

Nazar Hussain nazarhussain

🎯
Focusing
View GitHub Profile
@nazarhussain
nazarhussain / benchmarks_results.csv
Created April 17, 2020 14:18
Transaction Pool Benchmark Results
Max Transactions Transactions Per Account Spent Time Min Spent Time Max Spent Time Average Transaction Size Min Transaction Size Max Transaction Size Average
1024 16 2048 2048 2483 15470 15470 15626
1024 32 2124 2124 2348 15470 15470 15600
1024 48 2070 2070 2401 15470 15470 15561
1024 64 2132 2132 2431 15470 15470 15574
1024 80 1988 1988 2366 15470 15470 15587
1024 96 2054 2054 2383 15470 15470 15652
1024 112 2125 2125 2333 15470 15470 15600
1024 128 2108 2108 2302 15470 15470 15483
1024 144 2036 2036 2321 15470 15470 15574
@nazarhussain
nazarhussain / signed_leb128_encode_decode.py
Last active July 11, 2021 04:20
LEB128 - Base 128 Varints Algorithm
from unsigned_leb128_encode_decode import decode_unsigned_leb128, encode_unsigned_leb128
# Python 3.7.4
def encode_signed_leb128(number):
# Higher multiple of 7
bits_multiple_of_7 = ((number.bit_length() + 7) // 7) * 7
twos_complement = (1 << bits_multiple_of_7) - number
@nazarhussain
nazarhussain / benchmark.ts
Created June 16, 2025 11:50
Perfomance comparison for `Bun.spawn` vs `node:child_process` compatibility layer
#!/usr/bin/env bun
import { spawn, exec } from 'node:child_process';
import { promisify } from 'node:util';
const execAsync = promisify(exec);
// Utility functions
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
Feature Target Lib Single Feature Lib
Iterator Helper Methods ESNext esnext esnext.iterator
Set Methods ESNext esnext esnext.collection
New Regexp features ESNext esnext esnext.regexp
Promisel.try ESNext esnext esnext.promise
Float 16 support ESNExt esnext esnext.float16
grep "\[ '/ipfs/id/1.0.0' \] - UnexpectedEOFError: unexpected end of input" *.log *.log.* | awk -F'/ip4/' '{if (NF>1) print $2}' | awk -F'/' '{print $1}' | sort -u
103.241.50.8
103.242.110.40
103.242.110.41
104.219.237.146
104.219.238.66
107.6.91.43
107.6.94.197
116.202.146.113
120.88.122.183