Skip to content

Instantly share code, notes, and snippets.

View gist:0aa04d4eae81c11d99a87925a02d00a8
Before and after comparing the CPU usage of the kudu tserver,
scanning the ~3.4B rows of the l_shipmode column from TPCH lineitem:
Before
=============
Performance counter stats for 'numactl -m 0 -N 0 build/release/bin/kudu-tserver -fs-wal-dir /data/1/todd/tpch-kudu-data/ts-0/wal/ -fs-data-dirs /data/1/todd/tpch-kudu-data/ts-0/data/':
137,685.93 msec task-clock # 3.356 CPUs utilized
106,215 context-switches # 0.771 K/sec
706 cpu-migrations # 0.005 K/sec
View gist:c499807a6b4f1e6e0f94f039b5a3b151
Before and after comparing the CPU usage of the kudu tserver,
scanning the ~3.4B rows of the l_shipmode column from TPCH lineitem:
Before
=============
Performance counter stats for 'numactl -m 0 -N 0 build/release/bin/kudu-tserver -fs-wal-dir /data/1/todd/tpch-kudu-data/ts-0/wal/ -fs-data-dirs /data/1/todd/tpch-kudu-data/ts-0/data/':
137,685.93 msec task-clock # 3.356 CPUs utilized
106,215 context-switches # 0.771 K/sec
706 cpu-migrations # 0.005 K/sec
View 88-core.txt
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View r5d.2xlarge
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View thinkpad.txt
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View gist:573a9e5563d22ed56e38cac5aba26b30
todd@va1022:/tmp$ cat test.cc
int main() {
return __builtin_cpu_supports("bmi") ? 0 : 1;
}
todd@va1022:/tmp$ g++ ./test.cc -O2 ; ./a.out && echo "supports bmi" || echo "no bmi"
no bmi
todd@va1022:/tmp$ g++ ./test.cc -O2 /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libgcc.a ; ./a.out && echo "supports bmi" || echo "no bmi"
supports bmi
View gist:42e662d31233d6057d97d7ae5990e43b
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View gist:e81fcab79d304fa8fd37401e5b28e4b4
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View gist:6ddc5527c53082c781fd7d40fc996bae
Legend
===================
Methods:
fd: client sends a file descriptor for the server to fill
s-write: server writes data the passed fd using write() syscall
s-mmap: server mmaps() the passed fd and writes using memset()
s-reuse: server holds on to the mmapped region across calls
c-reuse: client holds on to the mmapped region across calls
sidecar: server sends back data over unix socket
nt: server uses nontemporal store instructions to write
View arrow-internal.h
// Curiously-recurring-template-pattern base class for private arrow data.
//
// This is similar to RefCountedThreadSafe<T> except that it participates in the
// C-style release callback expected by the Arrow C interface.
template<class T>
struct ArrowPrivateDataBase {
~ArrowPrivateDataBase() {
DCHECK_EQ(0, ref_count);
}