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 / index.html
Last active June 6, 2022 23:08
Techempower Postgres Verification
<!DOCTYPE html>
<html lang="en">
<head>
<title>Techempower Postgres Audit</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: monospace;
background-color: #f0f0f0;
@billywhizz
billywhizz / reader.js
Created July 31, 2021 13:15
POSIX shared memory example for just.js
const fd = just.sys.shmopen('/omgthisiscool')
const size = 1 * 1024 * 1024 * 1024
const ab = just.sys.mmap(fd, size)
const u32 = new Uint32Array(ab)
just.setInterval(() => {
just.print(Atomics.load(u32, 0))
}, 1000)
<p>
testing
</p>
@billywhizz
billywhizz / .gitignore
Last active February 19, 2021 22:26
stdio perf test for just-js
wc
wcb
scratch
@billywhizz
billywhizz / README.md
Last active January 24, 2021 07:22
sha256sum perf investigation - jan 2021

Create the test file

dd if=/dev/urandom of=/dev/shm/random.bin bs=65536 count=10000

Compile the c program

gcc -g -O3 -o sha256sum sha256sum.c
function checksum (file) {
const source = Buffer.alloc(65536)
const fd = openSync(file)
const hash = createHash('sha256')
let bytes = readSync(fd, source)
while (bytes > 0) {
if (bytes < 65536) {
hash.update(source.slice(0, bytes))
} else {
hash.update(source)
const { allFortunes } = sock
allFortunes.call(() => {
const html = getHTML(insertionSort([extra, ...allFortunes.getRows()]))
sock.writeString(`${rHTML}${utf8Length(html)}${END}${html}`)
})
sock.allFortunes = await compile(sock, {
formats: [],
sql: 'select * from Fortune',
fields: [{ format: 1, oid: INT4OID }, { format: 0, oid: VARCHAROID }],
name: 's2',
portal: '',
maxRows: 0,
htmlEscape: true,
params: []
})
sock.allFortunes = await compile(sock, {
formats: [],
sql: 'select * from Fortune',
fields: [{ format: 1, oid: INT4OID }, { format: 0, oid: VARCHAROID }],
name: 's2',
portal: '',
maxRows: 0,
htmlEscape: true,
params: []
})
@billywhizz
billywhizz / case.md
Last active October 18, 2020 00:09
v8 backingstore mutexes on access

v8 version

8.5.210.27

platform

linux, Ubuntu 18.06

arch