Cache Line

> I value user experience, which means I value performance. > > For most of my career I didn't know what a "cache line" was, or how dramatically certain memory details affect how fast code runs. I wish I'd known sooner! > > This talk teaches that stuff. I can't recommend it enough! 😍

# Stop Memorizing Stuff, I Can Calculate That

VIMEO 649009599 A Practical Guide to Applying Data-Oriented Design talk by Andrew Kelley, twitter

readv, writev, preadv, pwritev - read or write data into multiple buffers man page referenced in Cache Line, video at 43:15

> Bonus: Reading from and writing to the cache is done with a single preadv/pwritev syscall.

Computer from a Memory Perspective

## Summary (46:00) * Add CPU cache to your mental model of computers. * The CPU is fast but main memory is slow. * Identify where you have many things in memory, and make the size of each thing smaller. * There are a bunch of handy tricks to reduce the size of things in memory. ** […]

"encode"

** Use "encodings" instead of OOP/polymorphism

Escaping Addresses c2.com > Lisp, for example, has the very unique feature that code is data, and this property allows it to "encode" in metadata, the structures that are to emerge in a morphogenesis process. -- Mike Beedle

.

* As you can see with the Zig compiler, the performance benefits are huge.

## Case Study: ZIG Compiler

* Zig Programming Language Blurs the Line Between Compile-Time and Run-Time post * Zig site * Cross-compile a C/C++ Project with Zig post * Zig NEWS site * Taking the warts off C, with Andrew Kelley, creator of the Zig programming language podcast

YOUTUBE gn3YsZ6HUHw S2, E7: Taking the warts off C, with Andrew Kelley, creator of the Zig Software Foundation, 2021

> How do you improve on C? In this episode of the Sourcegraph Podcast, Andrew Kelley, creator of the Zig programming language and the founder and president of the Zig Software Foundation, joins Beyang Liu, co-founder and CTO of Sourcegraph and special guest Stephen Gutekanst, software engineer at Sourcegraph, to talk about what it takes to create a new programming language. Along the way, Andrew shares how programmers can get funding for their side projects and hobbies, why conditional compilation exposes philosophical differences between Zig and C, and explains why and how Zig can be faster than both C and Rust.

Comment from "S B": > Kinda weird to talk about Zig yet not be versatile with C or C++