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]
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

Setenv is not Thread Safe and C Doesn't Want to Fix It

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

Random Load Balancing is Unevenly Distributed

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

How much does the read/write buffer size matter for socket throughput?

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

The C Standard Library Function isspace() Depends on Locale

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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"...
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

Huge Pages are a Good Idea

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

Replicating Database Changes to a Message Queue is Tricky

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

Go: Functional options are slow

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

Postgres large JSON value query performance

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
Getting $3300 from a casino promotion New York State legalized mobile sports gambling in January 2022. The casinos offered crazy...
22nd Jan 2022
50

Getting $3300 from a casino promotion

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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...
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

Network Latencies in the Data Center

from Evan Jones - Software Engineer | Computer Scientist [alt+shift+b] in programming

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