Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]

Evan Jones - Software Engineer | Computer Scientist

Sort By

Recent [alt+2]
Evan Jones -...
Setenv is not Thread Safe and C Doesn't Want to Fix It You can't safely use the C setenv() or unsetenv() functions in a program that uses threads. Those...
19th Nov 2023
69
19th Nov 2023
You can't safely use the C setenv() or unsetenv() functions in a program that uses threads. Those functions modify global state, and can cause other threads calling getenv() to crash. This also causes crashes in other languages that use those C standard library functions, such as...
Evan Jones -...
Random Load Balancing is Unevenly Distributed This is a reminder that random load balancing is unevenly distributed. If we distribute a set of...
29th Aug 2023
57
29th Aug 2023
This is a reminder that random load balancing is unevenly distributed. If we distribute a set of items randomly across a set of servers (e.g. by hashing, or by randomly selecting a server), the average number of items on each server is num_items / num_servers. It is easy to...
Evan Jones -...
How much does the read/write buffer size matter for socket throughput? The read() and write() system calls take a variable-length byte array as an argument. As a...
16th Jul 2023
103
16th Jul 2023
The read() and write() system calls take a variable-length byte array as an argument. As a simplified model, the time for the system call should be some constant "per-call" time, plus time directly proportional to the number of bytes in the array. That is, the time for each call...
Evan Jones -...
The C Standard Library Function isspace() Depends on Locale This is a post for myself, because I wasted a lot of time understanding this bug, and I want to be...
6th Jun 2023
110
6th Jun 2023
This is a post for myself, because I wasted a lot of time understanding this bug, and I want to be able to remember it in the future. I expect close to zero others to be interested. The C standard library function isspace() returns a non-zero value (true) for the six "standard"...
Evan Jones -...
Huge Pages are a Good Idea Nearly all programs are written to access virtual memory addresses, which the CPU must translate to...
16th Jan 2023
62
16th Jan 2023
Nearly all programs are written to access virtual memory addresses, which the CPU must translate to physical addresses. These translations are usually fast because the mappings are cached in the CPU's Translation Lookaside Buffer (TLB). Unfortunately, virtual memory on x86 has...
Evan Jones -...
Replicating Database Changes to a Message Queue is Tricky Let's imagine we have an program that stores its state in a database, and we want other programs to...
13th Dec 2022
55
13th Dec 2022
Let's imagine we have an program that stores its state in a database, and we want other programs to do things when changes occur. For example, we might want to send email notifications if a bank balance drops below a threshold. This is a very common reason applications use...
Evan Jones -...
Go: Functional options are slow The Go "functional options" pattern is a way of passing options to a function. The function takes a...
23rd May 2022
56
23rd May 2022
The Go "functional options" pattern is a way of passing options to a function. The function takes a variable number of arguments, which are themselves functions (a type like ...func(*config). I think it was first introduced by Rob Pike in a 2014 blog post. It is now used by many...
Evan Jones -...
Postgres large JSON value query performance Postgres supports three types for "schemaless" data: JSON (added in 9.2), JSONB (added in 9.4), and...
1st Feb 2022
54
1st Feb 2022
Postgres supports three types for "schemaless" data: JSON (added in 9.2), JSONB (added in 9.4), and HSTORE (added in 8.2 as an extension). Unfortunately, the performance of queries of all three gets substantially slower (2-10×) for values larger than about 2 kiB, due to how...
Evan Jones -...
Getting $3300 from a casino promotion New York State legalized mobile sports gambling in January 2022. The casinos offered crazy...
22nd Jan 2022
50
22nd Jan 2022
New York State legalized mobile sports gambling in January 2022. The casinos offered crazy promotions to get people signed up. The craziest offered $3300 of free money. I did the math, and there was a low risk way to claim this money. As long as you placed 11 or more bets, you...
Evan Jones -...
Network Latencies in the Data Center Jeff Dean used to do a talk that included "Numbers Everyone Should Know" (2007 at Stanford, 2009 at...
25th Sep 2021
50
25th Sep 2021
Jeff Dean used to do a talk that included "Numbers Everyone Should Know" (2007 at Stanford, 2009 at LADIS), which included "round trip within same data center" as 500 us. I was recently wondering if that is still true, and more importantly what does the distribution of latencies...
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in