PHP 8.2.30
Preview: b.ts Size: 473 B
/home/byroehnu/.trash/node_modules11/pg-protocol/src/b.ts

// file for microbenchmarking

import { BufferReader } from './buffer-reader'

const LOOPS = 1000
let count = 0
const start = performance.now()

const reader = new BufferReader()
const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0])

const run = () => {
  if (count > LOOPS) {
    console.log(performance.now() - start)
    return
  }
  count++
  for (let i = 0; i < LOOPS; i++) {
    reader.setBuffer(0, buffer)
    reader.cstring()
  }
  setImmediate(run)
}

run()

Directory Contents

Dirs: 2 × Files: 9

Name Size Perms Modified Actions
testing DIR
- drwxr-xr-x 2026-02-03 15:06:20
Edit Download
types DIR
- drwxr-xr-x 2026-02-03 15:06:18
Edit Download
473 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.41 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
2.44 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
15.04 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
443 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
6.31 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
8.36 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
12.69 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
7.02 KB lrw-r--r-- 2026-02-03 15:06:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).