Skip to content

Instantly share code, notes, and snippets.

View JJJollyjim's full-sized avatar

Jamie JJJollyjim

View GitHub Profile
@JJJollyjim
JJJollyjim / 0-readme.txt
Created February 21, 2023 09:24 — forked from dougallj/0-readme.txt
Intel/AGX ternary logic optimisation tables (VPTERNLOGD -> AGX/x86/BMI/SSE2)
Usage: evaluate a ternary bitwise function with the values a=0xf0, b=0xcc, c=0xaa.
On AVX-512 you can pass the result directly to VPTERNLOGD. On other platforms,
look up the value in the following tables to find a short, equivalent sequence of
operations.
For A64/SVE/Neon see https://gist.github.com/dougallj/10c3ffdbd07229db2cc8b0430d7ccd39
The tables here are:
* agx: "not" and all binary operations (as used in Apple GPUs, but possibly useful elsewhere):
32-bit register dumps from dart-isp0 and dart-avd0 (two each), while viewing the camera preview in
photo booth and viewing an h.264 video in quicktime. all numbers in hex.
offset| dart-isp0 | dart-avd0
| (t6000) | (t8110)
------+---------------------+--------------------
+0 | 1eff1020 | 1eff1020 | 2ef01036 | 2ef01036
+4 | 21037 | 21037 | 30110002 | 30110002
+8 | 2a20122a | 2a20122a | 2a240100 | 2a240100
+c | 0 | 0 | 100010 | 100010
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
```
~/M/rio ❯❯❯ target/release/examples/o_direct ✘ 130
[examples/o_direct.rs:57] post_submit - pre = 33.978026152s
[examples/o_direct.rs:57] post_complete - post_submit = 2.136211581s
rio profile:
op | min (us) | med (us) | 90 (us) | 99 (us) | 99.9 (us) | 99.99 (us) | max (us) | count | sum (s)
--------------------------------------------------------------------------------------------------------------------------------------
sq:
sq_mu_hold | 0.2 | 3.0 | 4.0 | 4.9 | 615.4 | 864.6 | 946.0 | 10243 | 0.046
sq_mu_wait | 0.1 | 0.8 | 1.1 | 1.4 | 2.0 | 21.4 | 24.3 | 10243 | 0.007

Benchmark

dd

~/M/rio ❯❯❯ command time dd if=/dev/zero bs=1M count=4096 of=file
0.00user 5.15system 0:12.81elapsed 40%CPU (0avgtext+0avgdata 2980maxresident)k
80inputs+8388608outputs (1major+340minor)pagefaults 0swaps

rio

Keybase proof

I hereby claim:

  • I am jjjollyjim on github.
  • I am jjjollyjim (https://keybase.io/jjjollyjim) on keybase.
  • I have a public key ASCqwZGxkDN6LxINWh4g69_9opI1zT2yxe4C7d_769AqBAo

To claim this, I am signing this object:

#!/usr/bin/env python3
import library
print(library.my_string)
my_string = "Hello, World"
We couldn’t find that file to show.
@JJJollyjim
JJJollyjim / index.js
Created September 15, 2013 11:00
Cluster & Toobusy - an awesomely scalable node setup
// Include libraries
var express = require('express');
var cluster = require('cluster');
var toobusy = require('toobusy');
if (cluster.isMaster) {
var cpus = require("os").cpus();
console.log("CPU Info:");
console.log(cpus);